Jared
Jared

Reputation:

Visual Studio 2008 C++ Problems

I'm trying to write a program to calculate the quadratic formula. When I run it, I get 2 error messages:

error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
fatal error LNK1120: 1 unresolved externals

this is after I changed the last line of code from ...:

<< danswer1, danswer2 >>

to

<< danswer1 << "," << danswer2 <<

Before I made that change I got 2 compiler errors: C2563 and C2568. On a friend's computer the program worked perfectly.

What can I do to fix this?

Upvotes: 1

Views: 362

Answers (2)

Frank Krueger
Frank Krueger

Reputation: 70973

You can change to a console app by going to the Project Properties, Configuration Properties, Linker, System editor. You can then switch your SubSystem from Windows to Console (or vice-versa). Make sure to do this for both your Debug and Release configurations.

Upvotes: 1

PiNoYBoY82
PiNoYBoY82

Reputation: 1658

Is your project a Win32 Console Application or a Win32 Application? If you are using regular main(int argc, char** argv), then make sure your app is a console app.

Upvotes: 1

Related Questions