c - 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.
解决方案
推荐阅读
- javascript - 在 React Js 中使用“this”
- c# - 在C#中的处理方法中途显示消息
- javascript - 将数组的中心值和所有周围值合并到另一个数组中的特定值上?
- javascript - 配置信息是否安全地位于 Vue 的 Main.js 中
- testing - Testcafe 可访问性测试作为一个模块
- string - F# 交换字符串中字母的最佳方法
- android - 带有列表项的 Mvvmcross Viewpager
- python - 气流任务在失败时无法正确重试
- time-series - fpp 包中的自定义频率
- onem2m - 哪些结果内容类型对发现有效,哪些对非发现检索有效?