Advertisement

unresolved external errors

Started by February 24, 2002 11:19 AM
2 comments, last by Anidem 22 years, 8 months ago
These are the errors I got when compiling my application, however, I don't understand them. Can someone help? Linking... LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16 Debug/Test.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. Just in case someone needs the code to help figure out the errors:
#include <iostream.h> //Enables us to access cout

class Cat
{
	public:
		int  GetAge();
		void SetAge (int age);
		void Meow();
	private:
		int itsAge;
};

int Cat::GetAge()
{
	return itsAge;
}

void Cat::SetAge(int Age)
{
	itsAge = Age;
}

void Cat::Meow()
{
	cout << "Meow.\n";

}

int main()
{
	Cat Bryan;
	cout << Bryan.GetAge();
	Bryan.SetAge(7);
	Bryan.Meow();
	cout << Bryan.GetAge();
	return 0;
} 
Edited by - Anidem on February 24, 2002 12:20:42 PM
u should really read the beginners forum before posting this but, since ur obviously a beginnner ill help anywhay.....(assuming your using VC++) you have created a win32 appilcation, which requires knowledge of the winapi, the error says its looking for the win32 equvilant of main() it wants WinMain, you have to build a new project and select win32 console app, then you code will work

BTW, use #include <isotream> its supposedly the "new and better" one, but i dont see a diff

,Matt

-= kill one your a murderer, kill thousands your a conquerer =-
-= kill one you're a murderer, kill thousands you're a conquerer =-
Advertisement
You probably made a win32 application instead of a console app. The linker is looking for winmain, but cant find it. Try making a console app and it should work.

Beat me to it

Edited by - Sheep on February 24, 2002 12:26:12 PM
thanks

This topic is closed to new replies.

Advertisement