abc.cpp
#include
using namespace std;
class MY
{
public:
void MY::print()
{
cout<<"sdjflsdj"<<endl;
}
};
int _tmain(int argc, _TCHAR* argv[])
{
MY my;
my.print();
return 0;
}
g++ abc.cpp
abc.cpp:9: error: extra qualification ‘MY::’ on member ‘print’
去掉MY::編譯通過
1。有可能是g++不支持
2。編譯時加上-std=...指定用什麼標准試試