小编Rob*_*bin的帖子

clang ++(版本5)和LNK4217警告

我只是在学习如何编码.

我使用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;
}
Run Code Online (Sandbox Code Playgroud)

命令

clang++ -o .\bin\testing.exe test.cpp
Run Code Online (Sandbox Code Playgroud)

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)
Run Code Online (Sandbox Code Playgroud)

我在网上搜索过,可以找到类似的问题,但它们不一样.

我意识到这对你们来说可能很简单,但我不知道我使用过各种IDES和GCC,而且此代码之前没有产生过这个警告.

linker compiler-warnings clang++

18
推荐指数
1
解决办法
4886
查看次数

标签 统计

clang++ ×1

compiler-warnings ×1

linker ×1