|
-
Mar 11th, 2001, 09:19 PM
#1
Thread Starter
Frenzied Member
Code:
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/Random.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
heres my code:
Code:
#include <iostream.h>
class AGE {
public:
void showage();
void setage(int eAge);
protected:
int age;
};
void AGE::showage() {
cout<<age;
}
void AGE::setage(int eAge) {
age=eAge;
}
int main()
{
AGE steve;
int iage;
cin>>iage;
steve.setage(iage);
steve.showage();
int dummy;
cin>>dummy;
return 0;
}
I'm stumped.
-
Mar 11th, 2001, 09:37 PM
#2
Frenzied Member
Notice the error mentions "unresolved external WinMain"? It's looking for a function called WinMain() but it can't find one. Why would it do that? Because your project is a Win32 application, not a Win32 console application, that's why. Similarly, if you get "unresolved external _main" or something like that, it's usually because your project is a console app and you're writing Windows code (Windows apps start at WinMain(), not main() ).
Harry.
"From one thing, know ten thousand things."
-
Mar 11th, 2001, 09:59 PM
#3
Thread Starter
Frenzied Member
sorry must have pushed the wrong button
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
|