我有以下代码:编译错误:未定义的符号: “_main”,从引用:开始crt1.10.5.o
#include <iostream>
using namespace std;
class testing{
int test() const;
int test1(const testing& test2);
};
int testing::test() const{
return 1;
}
int testing::test1(const testing& test2){
test2.test();
return 1;
}
编译后,它给了我下面的错误:
Undefined symbols:
"_main", referenced from:
start in crt1.10.5.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
为什么它抱怨主要?我不能在另一个文件中声明main并包含这个文件吗?
非常感谢!