【发布时间】:2017-03-02 01:08:02
【问题描述】:
我只是在学习如何编码。
我已经使用 Visual Studio 14 在 Windows 10 系统上安装了 clang 版本 5。
我创建了一个 hello world cpp 文件来测试它是否正常工作。
示例代码
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!\n";
int rip{1};
int dal{4};
int kane = rip + dal;
cout << kane;
return 0;
}
命令
clang++ -o .\bin\testing.exe test.cpp
Clang 确实编译了,我得到了一个可以按预期运行的可执行文件。但是我确实收到了这条消息。
test-3e53b3.o : warning LNK4217: locally defined symbol ___std_terminate imported in function "int `public: __thiscall std::basic_ostream<char,struct std::char_traits<char> >::sentry::~sentry(void)'::`1'::dtor$5" (?dtor$5@?0???1sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@XZ@4HA)
test-3e53b3.o : warning LNK4217: locally defined symbol __CxxThrowException@8 imported in function "public: void __thiscall std::ios_base::clear(int,bool)" (?clear@ios_base@std@@QAEXH_N@Z)
我在网上搜索过,可以找到类似的问题,但它们并不相同。
我意识到这对你们来说可能很简单,但是我很茫然,我使用了各种 IDES 和 GCC,而且这段代码以前没有产生过这个警告。
【问题讨论】:
标签: linker compiler-warnings clang++