unresolved external symbol

Hello

Can someone suggest what the problem is please?

Many thanks in advance.

Graham

*******************************************************888
1>------ Build started: Project: output, Configuration: Debug Win32 ------
1> output.cpp
1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
1>c:\users\graham\documents\visual studio 2010\Projects\output\Debug\output.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

*************************************************************

// output.cpp : Defines the entry point for the console application.
//writes data to file
#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;

int main()
{
string survey;
string name;
int age;
string sex;
int number;
string classno;
string favcolour;

// input section
cout << "What is your name please?" << endl;
cin>> name;
cout << "What is your age please?" << endl;
cin>> age;
cout << "Are you male or female please?" << endl;
cin>> sex;
cout << "What is your number please?" << endl;
cin>> number;
cout << "What is your class please?" << endl;
cin>> classno;
cout << "What is your favourite colour please?" << endl;
cin>> favcolour;

// ofstream myfile ("C:/users/graham/documents/survey.txt") ;
// if (myfile.is_open())
// {
// cin>> name;
// cin>> age;
// cin>> sex;
// cin>> number;
// cin>> classno;
// cin>> favcolour;

// myfile << survey;
cout << "complete! " << endl;
// }
// else
// {
// cout << "\nerror";

//wait for return key
cin.get () ;
system( "PAUSE" );
return 0;
// }
}
You must've created a win32 project so it's t's looking for a WinMain() rather than regular old main(). Try making a console application.
ha ha how silly of me.

Many thanks, problem solved :))
Topic archived. No new replies allowed.