Undefined Reference To WinMain@16
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]
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?
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.
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
Quote:Original post by PalidineQuote: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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement