小编Son*_*Pig的帖子

为什么clang ++链接到gcc?

我有一个简单的"Hello,world"风格程序,我在FreeBSD上用clang ++编译:

#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char* argv[]) {
    cout << "Oh, hello" << endl;
    return EXIT_SUCCESS;
}
Run Code Online (Sandbox Code Playgroud)

我用clang ++和它的libc ++编译的:

$ clang++ -stdlib=libc++ -v ohhello.cpp 
FreeBSD clang version 3.8.0 (tags/RELEASE_380/final 262564) (based on LLVM 3.8.0)
Target: x86_64-unknown-freebsd11.0
Thread model: posix
InstalledDir: /usr/bin
 "/usr/bin/clang++" -cc1 -triple x86_64-unknown-freebsd11.0 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name ohhello.cpp -mrelocation-model static -mthread-model posix -mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -v -dwarf-column-info -debugger-tuning=gdb -resource-dir /usr/bin/../lib/clang/3.8.0 -internal-isystem /usr/include/c++/v1 -fdeprecated-macro -fdebug-compilation-dir /usr/home/mike/projects/ohhello -ferror-limit …
Run Code Online (Sandbox Code Playgroud)

c++ gcc freebsd clang++

4
推荐指数
1
解决办法
479
查看次数

标签 统计

c++ ×1

clang++ ×1

freebsd ×1

gcc ×1