Results 1 to 3 of 3

Thread: uh...what error is this?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    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...

  2. #2
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    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."

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    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
  •  



Click Here to Expand Forum to Full Width