我编译了一个从另一个项目移植过来的C++项目,编译后链接时有一些未定义的符号警告。关键是这些警告太奇怪了。它们分为 2 种类型:
类型 1:
dld: warning: Undefined symbol **'__record_needed_destruction'** in file './xxx/xx.o'
dld: warning: Undefined symbol **'__memzero'** in file './xxx/xyy.o'
dld: warning: Undefined symbol **'__vec_delete'** in file './xxx/xyz.o'
dld: warning: Undefined symbol **'__vec_new'** in file './xxx/yy/xxx/yyy.o'
dld: warning: Undefined symbol **'__pure_virtual_called'** in file './xxx/zzz.o'
关键是源代码中没有使用这些符号。那里的确切含义是什么?
类型 2:
dld: warning: Undefined symbol in file './xxx/x1.o', './xxx/x2.o', './xxx/x3.o':
nothrow__3std
**std::nothrow**
源代码如下:
ApplicationSystem* pApplicationSystem = **new(std::nothrow)** ApplicationSystem{
.....
.....
}
类似的语句出现在3个cpp文件中。使用std::nothrow有什么问题吗?