Jump to content
  • Advertisement
Sign in to follow this  
JamesEB

Dev C++ [Linker error]

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

#include <iostream> using namespace std; int Main() { int num1; int num2; int num3; int num4; int average; num1 = 125; num2 = 28; num3 = -25; num4 = 10; average = (num1 + num2 + num3 + num4) / 4; cout << "num1 = " << num1 << endl; cout << "num2 = " << num2 << endl; cout << "num3 = " << num3 << endl; cout << "num4 = " << num4 << endl; cout << "average = " << average << endl; system("pause"); return 0; } ________________________________________________________________________________ Theres my code when i compile it says [Linker error] undefined reference to WinMain@16 id returned 1 exit status. how can i fix this. just so you all know this is for a class debug project but iv been starin at this code for like 4 hours and cant figure out whats goin on with it.

Share this post


Link to post
Share on other sites
Advertisement
The project is set to be linked to a Windows application, whose entry point looks something like "int WINAPI WinMain( HINSTANCE, HINSTANCE, LPSTR, int )"; you'll need to change the project setting to link to a "Windows console application". You also shouldn't use Dev-C++, and use something better such as Microsoft Visual Studio 2008 Express or Codeblocks instead.

(Also, main shouldn't be capitalized.)

Share this post


Link to post
Share on other sites
not sure how to do that i have only been working with Devc++ for a few weeks could it have something to do with being saved on my flash drive? The class instructor wants us to use the DevC++ otherwise i would it sounds like there much better

Share this post


Link to post
Share on other sites
WOW Thanx a ton _Fastcall its upsetting to realize that my problem was Main was capitalized XD i feel like something worse than a noob right now.

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!