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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

fatal error LNK1120 using Visual C++ 6.0 with small prog.

Status
Not open for further replies.

jonnie75

Technical User
Nov 9, 2001
6
US
When I run this program I keeg getting a fatal error LNK1120, and I am not sure why. I am not sure why the functions are not working correctly, two books that I have say that it should.

#include <iostream>
using namespace std;

void mice();
void run();
int main()
{
mice();
mice();
run();
run();

return 0;
}

void mice()
{
cout << &quot;Three blind mice\n&quot;;
}

void run()
{
cout << &quot;See how they run\n&quot;;
}
 
I just copied and pasted what you posted into msvcpp and compiled it. It compiled and linked and ran fine. it outputted

Three blind mice
Three blind mice
See how they run
See how they run


I post this mainly to let you know that your code itself appears to be fine. What version of the compiler are you using? Can you tell me about how you made the file and then compiled it?
 
Thanks,
I'm not sure what I originally did. I deleted it all and retyped and recompiled it. It now works fine. Thanks for reviewing the code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top