2013-05-15 163 views
0

因此,我最近使用SDL库在ubuntu 32位上做了一个项目。但我想使用RAX等寄存器,所以我安装了64位,但是我收到有关丢失SDL的错误。缺少SDL库?

错误:

[email protected]:~/Desktop$ gcc -g -Wall `sdl-config --cflags` `sdl-config --libs` -lSDL_image -lSDL -lSDLmain -msse2 -o mmx mmx.c 
/tmp/ccCicye2.o: In function `Load_image': 
/home/artur/Desktop/mmx.c:104: undefined reference to `IMG_Load' 
/home/artur/Desktop/mmx.c:106: undefined reference to `SDL_GetError' 
/tmp/ccCicye2.o: In function `Paint': 
/home/artur/Desktop/mmx.c:115: undefined reference to `SDL_UpperBlit' 
/home/artur/Desktop/mmx.c:116: undefined reference to `SDL_UpdateRect' 
/tmp/ccCicye2.o: In function `main': 
/home/artur/Desktop/mmx.c:142: undefined reference to `SDL_Init' 
/home/artur/Desktop/mmx.c:143: undefined reference to `SDL_GetError' 
/home/artur/Desktop/mmx.c:154: undefined reference to `SDL_WM_SetCaption' 
/home/artur/Desktop/mmx.c:157: undefined reference to `SDL_VideoModeOK' 
/home/artur/Desktop/mmx.c:172: undefined reference to `SDL_SetVideoMode' 
/home/artur/Desktop/mmx.c:174: undefined reference to `SDL_GetError' 
/home/artur/Desktop/mmx.c:180: undefined reference to `SDL_SetColors' 
/home/artur/Desktop/mmx.c:192: undefined reference to `SDL_PollEvent' 
/home/artur/Desktop/mmx.c:203: undefined reference to `SDL_LockSurface' 
/home/artur/Desktop/mmx.c:209: undefined reference to `SDL_UnlockSurface' 
/home/artur/Desktop/mmx.c:238: undefined reference to `SDL_RWFromFile' 
/home/artur/Desktop/mmx.c:238: undefined reference to `SDL_SaveBMP_RW' 
/home/artur/Desktop/mmx.c:254: undefined reference to `SDL_Delay' 
/home/artur/Desktop/mmx.c:257: undefined reference to `SDL_FreeSurface' 
/home/artur/Desktop/mmx.c:259: undefined reference to `SDL_Quit' 
collect2: error: ld returned 1 exit status 

我安装了SDL中,得到了SDLimage.h和SDL.h在SDL目录下的usr/include目录。

任何帮助? :E

它可以在好的32b Ubuntu上运行..

+0

我的名字从字面上下载的每包“SDL”现在从新立..没有帮助.. –

+0

为什么你'-lSDL -lSDLmain'在那里当你在使用'sdl- config'? 'SDLimage.h'从哪里来? – genpfault

回答

0

选项顺序很重要。试试这个:

gcc -g -Wall mmx.c -o mmx `sdl-config --cflags` `sdl-config --libs` -lSDL_image -msse2