Archived

This topic is now archived and is closed to further replies.

the_fish

SDL trouble

Recommended Posts

Hi there, I'm just beginning to do some stuff using SDL. I'm trying to compile something right now and I'm getting these errors (though both are about the same thing): SDLmain.lib(SDL_main.obj) : error LNK2001: unresolved external symbol _SDL_main Debug/SDL_SpriteClass.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. I've made sure it knows where SDLmain.lib and SDL.lib are, so everything's okay though, but yet I'm getting this error. (I've also set it to use "multithreaded DLL" run-time library). Any ideas? I'm really getting frustrated since everything else is fine as far as I know but I can't see the result! Thanks, the_fish [edited by - the_fish on January 17, 2004 10:53:52 AM]

Share this post


Link to post
Share on other sites
What developmeent environment are you using? Some require the -lSDLmain linker flag.

And as the other poster mentiond, make sure your main function is declared with the two standard aguments.

Share this post


Link to post
Share on other sites
quote:
Original post by the_fish
Hi there,

I''m just beginning to do some stuff using SDL. I''m trying to compile something right now and I''m getting these errors (though both are about the same thing):

SDLmain.lib(SDL_main.obj) : error LNK2001: unresolved external symbol _SDL_main
Debug/SDL_SpriteClass.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

I''ve made sure it knows where SDLmain.lib and SDL.lib are, so everything''s okay though, but yet I''m getting this error. (I''ve also set it to use "multithreaded DLL" run-time library).

Any ideas? I''m really getting frustrated since everything else is fine as far as I know but I can''t see the result!

Thanks,
the_fish

[edited by - the_fish on January 17, 2004 10:53:52 AM]

If you are using VC++ 7. Did you include the dll''s has resources or did you include the paths to the include and lib files. You should try both. Also inlcude SDL.dll in the project folder.

Share this post


Link to post
Share on other sites
Depending on what compiler you''re using, the order that the lib''s appear in might matter. For example, I was trying out an SDL test program of mine on mingw the other day and I had to make sure SDLmain.lib appears BEFORE SDL.lib or it won''t link properly. On the otherhand, the borland compiler that I usually use doesn''t care about this minor detail.





--{You fight like a dairy farmer!}

Share this post


Link to post
Share on other sites