sadasfsdafas fgasgasd
sadasfsdafas fgasgasd

Reputation: 41

Missing SDL library?

So, I recently made a project on ubuntu 32 bit, using SDL libraries. But I want to use RAX etc. registers so I installed 64 bit, but I am getting error about missing SDLs.

Error:

artur@ubuntu:~/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

I installed SDLs, got SDLimage.h and SDL.h in SDL catalog under usr/include.

Any help? :E

It works on good damn 32b ubuntu..

Upvotes: 0

Views: 1438

Answers (1)

genpfault
genpfault

Reputation: 52082

Option order is important. Try this:

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

Upvotes: 1

Related Questions