Jump to content
  • Advertisement
Sign in to follow this  
Robo-Link

Linker Errors [Now Code::Blocks]

This topic is 3499 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

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]

Share this post


Link to post
Share on other sites
Advertisement
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...

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
Quote:
Original post by Robo-Link
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?


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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!