请解释此程序的错误消息..
#include <iostream>
using namespace std;
class copyConst
{
private:
int someVal;
public:
copyConst(const copyConst &objParam)
{
someVal = objParam.someVal;
}
copyConst()
{
someVal = 9;
}
copyConst& operator=(const copyConst &objParam)
{
if (this == &objParam)
return *this;
someVal = objParam.someVal;
return *this;
}
};
int main(int argc, char **argv)
{
copyConst obj1;
copyConst obj2(obj1);
copyConst obj3 = obj1;
copyConst obj4;
obj4 = obj1;
return 0;
}
错误信息:
gcc -Wall -o "untitled" "untitled.cpp" (在目录:/home/rwik/Documents) untitled.cpp: 在函数'int main(int, char**)': untitled.cpp:53:12:警告:变量 'obj3' 已设置但未使用 [-Wunused-but-set-variable] /tmp/ccUIyRPg.o: In function
__static_initialization_and_destruction_0(int, int)': untitled.cpp:(.text+0x8a): undefined reference to
std::ios_base::Init::Init()' untitled.cpp:(.text+ 0x8f): 未定义引用 `std::ios_base::Init::~Init()' 编译失败。collect2: ld 返回 1 个退出状态