SDL trouble

Started by
3 comments, last by the_fish 20 years, 3 months ago
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]
Advertisement
You need to declare your main() method as int main(int argc, char *argv[])
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.
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.

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!}

--{You fight like a dairy farmer!}

This topic is closed to new replies.

Advertisement