Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can this be generating errors??

Status
Not open for further replies.

JayMiller

Programmer
Jul 25, 2005
1
US
I have a few months worth of C++ knowledge under my belt, and have been able to troubleshoot my code before, but I came back to VS.Net after a brief hiatus, and, to make a long story short, I cannot figure how this bit of could be generating errors:

Code:
#include <iostream>
using namespace std;
int main()
{      
	std::cout<<"Cliche Statement Here"<<endl;
}

Here's what it spits out:

Code:
LIBCD.lib(wincrt0.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function _WinMainCRTStartup

Debug/Test.exe : fatal error LNK1120: 1 unresolved externals

I've been searching various forums for some clues but haven't turned up anything yet. Anyone have any idea as to why I would be getting these from these? At this point, any and all theroies will result in my undying gratitude.

 
Code:
#include <iostream>
using namespace std;
int main()
{      
    cout<<"Cliche Statement Here"<<endl;
}

This should work. Try it.
 
The problem is not with the code. The problem is with the project you created in VC++. You created a windows app instead of a console application.

When you create your new project, choose Win32->Win32 Console Project. Then in the wizard that appears switch to Application Settings and check the Empty project option. This will create the simple console project you want. Then your code should build.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top