[SDL] compiling SDL codes
Alex Barry
alex.barry at gmail.com
Fri Mar 23 13:41:22 PDT 2012
And by "like" I meant "link"
Just always assume the compiler is stupid and you need to tell it every
step you want it to take.
-Alex
On Fri, Mar 23, 2012 at 4:40 PM, Mohsen Jamali <mohsen.aria at gmail.com>wrote:
> Thanks dear Alex :-x
>
> On Sat, Mar 24, 2012 at 1:00 AM, Alex Barry <alex.barry at gmail.com> wrote:
>
>> You need to like with SDL
>>
>> g++ -o main main.cpp `sdl-config --libs --cflags`
>>
>> That should fix you up :)
>> -Alex
>>
>> On Fri, Mar 23, 2012 at 4:15 PM, Mohsen Jamali <mohsen.aria at gmail.com>wrote:
>>
>>> *Hi guys i have installed SDL on my ubuntu 11.10 machine but when i
>>> want to compile it i get the following error *:
>>> -*- mode: compilation; default-directory: "/home/mohsen/Desktop/ch02/"
>>> -*-
>>> Compilation started at Sat Mar 24 00:42:04
>>>
>>> g++ -o main main.cpp
>>> /tmp/ccsRr3LE.o: In function `render()':
>>> main.cpp:(.text+0x33): undefined reference to `SDL_LockSurface'
>>> main.cpp:(.text+0x43): undefined reference to `SDL_GetTicks'
>>> main.cpp:(.text+0x100): undefined reference to `SDL_UnlockSurface'
>>> main.cpp:(.text+0x124): undefined reference to `SDL_UpdateRect'
>>> /tmp/ccsRr3LE.o: In function `main':
>>> main.cpp:(.text+0x142): undefined reference to `SDL_Init'
>>> main.cpp:(.text+0x14e): undefined reference to `SDL_GetError'
>>> main.cpp:(.text+0x179): undefined reference to `SDL_Quit'
>>> main.cpp:(.text+0x197): undefined reference to `SDL_SetVideoMode'
>>> main.cpp:(.text+0x1af): undefined reference to `SDL_GetError'
>>> main.cpp:(.text+0x215): undefined reference to `SDL_PollEvent'
>>> collect2: ld returned 1 exit status
>>>
>>> Compilation exited abnormally with code 1 at Sat Mar 24 00:42:06
>>>
>>> *could anyone say whats wrong with me? i'm using emacs editor and use
>>> this command to compile:*
>>> Compile command: gcc -o main main.cpp
>>>
>>> _______________________________________________
>>> SDL mailing list
>>> SDL at lists.libsdl.org
>>> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>>>
>>>
>>
>> _______________________________________________
>> SDL mailing list
>> SDL at lists.libsdl.org
>> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>>
>>
>
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20120323/87e0b5f7/attachment.htm>
More information about the SDL
mailing list