2013-03-19 36 views
1

我在mac OS 10.8.2上运行并使用以下命令编译我的程序;SDL映像的问题

g++ main.cpp `sdl-config --cflags --libs` -o whateverfilename 

我可以编译SDL计划得很好,但只要我尝试使用SDL的图片库,不如意的事情 - 我得到以下错误:

Undefined symbols for architecture x86_64: 
    "_IMG_Init", referenced from: 
     _SDL_main in cco8lzYA.o 
    "_IMG_Load_RW", referenced from: 
     _SDL_main in cco8lzYA.o 
ld: symbol(s) not found for architecture x86_64 
collect2: ld returned 1 exit status 

我猜链接缺少搜索路径或其他东西。我一直在试图查找和编辑链接搜索路径,但似乎无法管理,即使有人可以告诉我如何做到这一点,或者我可能导致什么其他问题,我会很感激:)

回答

3

我认为你需要添加lSDL_Image编译器标志,当谈到C++和SDL时,我非常喜欢noob,因为我已经对它做了什么。

我也非常建议LazyFoo's tutorials

+0

收到尝试过,但有标志错误,使用“SDL_image”没有“L”。现在就工作,谢谢! – 2013-03-19 14:02:19