#include <iostream>
class A
{
public :
void f1();
void f2();
};
void A::f1()
{
std::cout<<"f1";
}
void A::f2()
{
std::cout<<"f2";
}
int mian()
{
A a;
a.f1();
return 0;
}
1>------ Build started: Project: 2011_4_8, Configuration: Debug Win32 ------
1>Compiling...
1>test.cpp
1>Linking...
1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
1>D:\C++\2011_4_8\Debug\2011_4_8.exe : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://d:\C++\2011_4_8\2011_4_8\Debug\BuildLog.htm"
1>2011_4_8 - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
vs2008,为什么会有错、、、
int mian() //Should be main instead of mian
{
A a;
a.f1();
return 0;
}
int mian() //Should be main instead of mian
{
A a;
a.f1();
return 0;
}