首页 > 解决方案 > SDL2:架构 x86_64 / MAC 的未定义符号

问题描述

我有一个错误可能是由于 SDL,但我找不到它。

我试图强制在 SDL2 和我的编译器之间建立链接,并检查所有字符以避免出现不在任何库中的特殊字符。我在同一个目录中有所有需要的文件。

#include <stdio.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_ttf.h>
#include <SDL2/SDL_image.h>


//Function with picture display

//Function with text creation and text display

//Here I create an array of transparent pictures to do a Connect 4

//Here it's the thing that always appear in my window

//Here are the button of my main menu

//After all those function there's my main

It just doesn't compile with this text of error : 

    mbp-de-clement:Test grille clementdubois$ make clean; make; ./test_grille

    rm -f test_grille

    rm -f *.o

    gcc     test_grille.c   -o test_grille

    Undefined symbols for architecture x86_64:

      "_IMG_Load", referenced from:

          _main in test_grille-b3d516.o

    ... (lot of errors due to SDL) ...


    ld: symbol(s) not found for architecture x86_64

    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    make: *** [test_grille] Error 1

    bash: ./test_grille: No such file or directory

I check all the posts on this site but can't find any help. I try to change my Makefile but nothing worked. I'm in desperate need of help for this project. 

标签: csdl

解决方案


推荐阅读