Linker Errors [Now Code::Blocks]
Okay, so I'm trying to port my project from VC++ to Bloodshed, and I've gotten everything down to a few errors. I've taken a screenshot that has my linker list, and build info. Can someone take a look at it and tell me how to correct these errors?
[Edited by - Robo-Link on December 17, 2008 5:52:35 PM]
According to the bloodshed site it was last updated nearly 4 years ago. Why are you trying to port to an out of date unsupported unused compiler? Stick with MSVC++ if I were you...
Quote:Original post by Cantos
If you want a MinGW build environment, you can try Code::Blocks instead.
Thanks. I'm using code blocks now. I have just one error:
C:\Program Files\CodeBlocks\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\libmingw32.a(main.o):main.c:(.text+0x104)||undefined reference to `_WinMain@16|
I'm linking to SDL like this:
Build settings -> [project name] -> Linker Settings:
opengl32
GlU32
SDL
SDLmain
And Build settings -> [project name] -> Search Directories -> Compiler:
..\..\SDL-devel-1.2.13-mingw32\SDL-1.2.13\include
And Build settings -> [project name] -> Search Directories -> Linker:
..\..\SDL-devel-1.2.13-mingw32\SDL-1.2.13\lib
Also, I have a Main referenced at main.cpp as int main(int argc, char **argv[])
Can someone please help?
Quote:Original post by Robo-LinkQuote:Original post by Cantos
If you want a MinGW build environment, you can try Code::Blocks instead.
Thanks. I'm using code blocks now. I have just one error:
C:\Program Files\CodeBlocks\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\libmingw32.a(main.o):main.c:(.text+0x104)||undefined reference to `_WinMain@16|
I'm linking to SDL like this:
Build settings -> [project name] -> Linker Settings:
opengl32
GlU32
SDL
SDLmain
And Build settings -> [project name] -> Search Directories -> Compiler:
..\..\SDL-devel-1.2.13-mingw32\SDL-1.2.13\include
And Build settings -> [project name] -> Search Directories -> Linker:
..\..\SDL-devel-1.2.13-mingw32\SDL-1.2.13\lib
Also, I have a Main referenced at main.cpp as int main(int argc, char **argv[])
Can someone please help?
Yes, you defined the wrong entrypoint for your program.
Instead of a main(), you need a WinMain according to this specification:
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow);
Toolmaker
Try a block like this around your main() function:
extern "C" {int main(int argc, char *argv[]){ ...}}
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement