|
-
Nov 14th, 2000, 09:40 PM
#1
Thread Starter
Frenzied Member
This works fine in borland...but I get this in ms:
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/Guess My Number.exe : fatal error LNK1120: 1 unresolved externals
here is the code
Code:
#include <iostream.h>
int number;
int guess;
int dummy;
int main()
{
//until i randomize NUMBER then its just going to be 34
number=34;
cout<<"Welcome To High Low!"<<endl;
cout<<"===================="<<endl;
cout<<"Enter a number between 1 and 100!"<<endl;
cin>>guess;
// if guess<number then it says too low, else it says too high, or if
// you get it, it says congrats
while (guess!=999)
{
if(guess<number)
{
cout<<"Too low! Guess again."<<endl;
cin>>guess;
}
else if(guess>number)
{
cout<<"Too high! Guess again."<<endl;
cin>>guess;
}
else if(guess==number)
{
cout<<"Congratulations! You Win!";
guess = 999;
}
}
//END OF WHILE STATEMENT
cin >> dummy;
return 0;
}
I know, Im a beginner...by the way, it would help me out a lot if you could also tell me how to make random numbers. But whats wrong?!?!?! Borland says its fine...
-
Nov 14th, 2000, 10:09 PM
#2
Frenzied Member
I think you may have created your project as a Win32 Application. Try creating a Win32 Console Application, if you haven't already.
It's looking for WinMain(), the starting point of a Windows application. Obviously, your project has a main() instead, and that's where the error is coming from
Harry.
"From one thing, know ten thousand things."
-
Nov 15th, 2000, 09:00 PM
#3
Thread Starter
Frenzied Member
wow...never even thought of that...thanks harry!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|