Sign in to follow this  
NickGravelyn

Undefined Reference To WinMain@16

Recommended Posts

NickGravelyn    855
I recently ported my SDL/OpenGL application to Windows and am developing using the Code::Blocks IDE. Everything is going smooth but I'm getting a linker error I cannot seem to fix. I'm used to development on Mac OS X so I'm a little new to Windows development. Any ideas? C:\Program Files\CodeBlocks\lib/libmingw32.a(main.o):main.c:(.text+0x106): undefined reference to `WinMain@16' [Edited by - NickGravelyn on March 13, 2006 1:01:11 PM]

Share this post


Link to post
Share on other sites
NickGravelyn    855
I resolved the undefined reference by putting the mingw32 library in the project options, but when I run it it tells me it can't find SDL.dll. I have a local copy (i.e. not inside of any Windows folders) so how can I tell it to use that?

Share this post


Link to post
Share on other sites
Dorvo    272
Quote:
Original post by NickGravelyn
I resolved the undefined reference by putting the mingw32 library in the project options, but when I run it it tells me it can't find SDL.dll. I have a local copy (i.e. not inside of any Windows folders) so how can I tell it to use that?


Put the dll in the same folder as your executable file.

Share this post


Link to post
Share on other sites
Palidine    1315
Quote:
Original post by xissburg
try to put the SDL.dll inside Windows/system32 folder


Dorvo's solution is better because if you want other people to use it you will have to ship with a local copy of the DLL. Otherwise they won't be able to run it without moving files into their system32 folder.

-me

Share this post


Link to post
Share on other sites
Dorvo    272
Quote:
Original post by Palidine
Quote:
Original post by xissburg
try to put the SDL.dll inside Windows/system32 folder


Dorvo's solution is better because if you want other people to use it you will have to ship with a local copy of the DLL. Otherwise they won't be able to run it without moving files into their system32 folder.

-me


... unless you make a custom installer for it. That, however, has some complications in itself. By copying your version of the dll to the system32 folder, you could overwrite an existing copy of the dll that another application might've installed. If your version is older than the one that's already there, it could break the other program(s). Which is very bad.

If you put the dll into the same folder as the exe, then your application is guaranteed to use that particular dll, and there's no chance of overwriting.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this