Archived

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

SDL & VC++

This topic is 5507 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m new to SDL (I havn''t done anything except try and set it up) and I''m having some problems. I''ve tried setting up SDL for use with VC++. I follow the instrustions, but using precompiled dlls. I compile alright, I just get the following link errors: SDLmain.lib(SDL_main.obj) : error LNK2001: unresolved external symbol _SDL_main Debug/SDLTest.exe : fatal error LNK1120: 1 unresolved externals I''ve added the SDL.lib and SDLmain.lib to the library directory in configurations too. (After it wasn''t working the first time). I''ve played around a bit, but can''t seem to find the problem. The projtus IS a multithreaded dll, but still doesn''t work. anybody able to help? or would it be best to get SDL working on linux? slip

Share this post


Link to post
Share on other sites
You must have a "int main (int argc, char* argv[])" function in your program. But did you go through the SDL tutorials on gamedev? SDL is very straight forward to set-up for MSVC, there are no hidden tricks.

Share this post


Link to post
Share on other sites
Diodor is right.
You could also try including SDLmain.lib before SDL.lib. If that doesn''t fix the problem go to project settings and select code generation in the c++ tab. There set the configuration to multithreaded dll for release build and to multithreaded dll debug for debug build. (My information may be not so accurate as i don''t have vc++ right here )

Share this post


Link to post
Share on other sites
quote:

Original post by baumep

You could also try including SDLmain.lib before SDL.lib.



I don''t know if that is important in MSVC, but it is mandatory for DevC++.

Share this post


Link to post
Share on other sites