Indra Gunawan

word of my mind, word of my heart.


[Linker error] undefined reference to `SDL_LockSurface'

Problems :
When you try to compile C++ code with SDL in Dev-C++ and you get the error message :

[Linker error] undefined reference to `SDL_LockSurface'
[Linker error] undefined reference to `SDL_UnlockSurface'
[Linker error] undefined reference to `SDL_UnlockSurface'
.
.
.
[Linker error] undefined reference to `WinMain@16'
ld returned 1 exit status


Sollution :

Project > Project Options (ALT+P) > Parameters > Linker

and then type :

-lmingw32
-mwindows
-lSDLmain
-lSDL


remember you must type as like that, do not to change the sequence. Ex, if you put -lSDL first and then -lSDLmain it won't work.

The last, you must carefully to read the word.
-lmingw32
-mwindows
-lSDLmain
-lSDL


in UPPERCASE must to be :
-LMINGW32
-MWINDOWS
-LSDLMAIN
-LSDL


so, you must type "l" (el) not "I" (ai-with UPPERCASE) in the fist char of lmingw32, -lSDLmain and -lSDL.


Note : SDL = Simple DirectMedia Layer

Labels: , ,

0 Responses to “[Linker error] undefined reference to `SDL_LockSurface'”

Post a Comment

Leave your comment :D

Newer›  ‹Older


Black Rose

I'm Indra Gunawan
From : Siak Sri Indrapura, Indonesia
Live : Kanazawa, Japan

Now I am school at Kindai, Japan.

I don't believe in luck and I love to made some poetry. :)


Search

Chit Chat



Recent Comments


    hit counter html code
  • since 22 Feb '08

  • Page Rank Check

My Social Networks


    Indra EhM's Facebook profile


Blogged Blog Directory
XML

Adsvertise