C ++ 11在代码块中的编译问题 [英] C++11 compilation issues in codeblocks

查看:233
本文介绍了C ++ 11在代码块中的编译问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎无法获得代码块13.12在clang ++和g ++中正确编译c ++ 11。我在使用clang ++编译时附加了-std = c ++ 11和-stdlib = libc ++。这导致链接错误。对于g ++,当添加-std = c ++ 11或-std = c ++ 0x时,编译器无法找到随机头。当我使用clang ++和g ++在终端中手动编译代码时,没有发生这些错误。



完整的链接器错误太长,从-v调用给出的信息。
在使用clang ++的代码块中使用-std = c ++ 11和-stdlib = libc ++:

  Apple LLVM版本5.1 (clang-503.0.40)(基于LLVM 3.4svn)
目标:x86_64-apple-darwin12.5.0
线程模型:posix
/ usr / bin / ld-demangle - dynamic -arch x86_64 -macosx_version_min 10.8.0 -o bin / Release / p_class_test obj / Release / Thread_Pool / thread_helper.o obj / Release / Thread_Pool / thread_pool.o obj / Release / Desktop / kmap_testing / hash_methods.o obj / Release / Desktop /p_class_test/p_classtest.o obj / Release / Desktop / p_class_test / refmanager.o -lstdc ++ -lSystem /usr/bin/../lib/clang/5.1/lib/darwin/libclang_rt.osx.a



使用clang ++在-std = c ++ 11和-stdlib = libc ++中编译:

  Apple LLVM版本5.1(clang-503.0.40)(基于LLVM 3.4svn)
目标:x86_64-apple-darwin12.5.0
线程模型:posix
/ usr / bin / clang-cc1 -triple x86_64-apple-macosx10.8.0 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file -name thread_helper.cpp -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 236.3 -v -resource-dir / usr / bin /../ lib / clang / 5.1 -I / Users / zacharykraus / Desktop / p_class_test / -I / Users / zacharykraus / Thread_Pool / -I / Users / zacharykraus / Desktop / kmap_testing / -stdlib = libc ++ -std = c + +11 -fdeprecated-macro -fdebug-compilation-dir / Users / zacharykraus -ferror-limit 19 -fmessage-length 80 -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime = macosx-10.8.0 -fencode-extended- block-signature -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o /var/folders/k5/ywc_m0js3z3byh3yqwbfmfj00000gn/T/thread_helper-57c077.o -x c ++ / Users / zacharykraus / Thread_Pool /thread_helper.cpp
clang -cc1版本5.1基于LLVM 3.4svn默认目标x86_64-apple-darwin12.5.0
忽略不存在的目录/ usr / include / c ++ / v1
#include ...搜索从这里开始:
#include< ...>搜索从这里开始:
/ Users / zacharykraus / Desktop / p_class_test
/ Users / zacharykraus / Thread_Pool
/ Users / zacharykraus / Desktop / kmap_testing
/usr/bin/../ lib / c ++ / v1
/ usr / local / include
/usr/bin/../lib/clang/5.1/include
/ usr / include
/ System / Library / Frameworks(框架目录)
/ Library / Frameworks(框架目录)
搜索列表的结尾。
/ usr / bin / clang-cc1 -triple x86_64-apple-macosx10.8.0 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name thread_pool.cpp -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 236.3 -v -resource-dir /usr/bin/../ lib / clang / 5.1 -I / Users / zacharykraus / Desktop / p_class_test / -I / Users / zacharykraus / Thread_Pool / -I / Users / zacharykraus / Desktop / kmap_testing / -stdlib = libc ++ -std = c ++ 11 -fdeprecated- macro -fdebug-compilation-dir / Users / zacharykraus -ferror-limit 19 -fmessage-length 80 -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime = macosx-10.8.0 -fencode-extended-block-signature -fcxx -exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o /var/folders/k5/ywc_m0js3z3byh3yqwbfmfj00000gn/T/thread_pool-321d19.o -x c ++ /Users/zacharykraus/Thread_Pool/thread_pool.cpp
clang -cc1版本5.1基于LLVM 3.4svn默认目标x86_64-apple-darwin12.5.0
忽略不存在的目录/ usr / include / c ++ / v1
#include...搜索从这里开始:
#include< ...>搜索从这里开始:
/ Users / zacharykraus / Desktop / p_class_test
/ Users / zacharykraus / Thread_Pool
/ Users / zacharykraus / Desktop / kmap_testing
/usr/bin/../ lib / c ++ / v1
/ usr / local / include
/usr/bin/../lib/clang/5.1/include
/ usr / include
/ System / Library / Frameworks(框架目录)
/ Library / Frameworks(框架目录)
搜索列表的结尾。
/ usr / bin / clang-cc1 -triple x86_64-apple-macosx10.8.0 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name hash_methods.cpp -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 236.3 -v -resource-dir /usr/bin/../ lib / clang / 5.1 -I / Users / zacharykraus / Desktop / p_class_test / -I / Users / zacharykraus / Thread_Pool / -I / Users / zacharykraus / Desktop / kmap_testing / -stdlib = libc ++ -std = c ++ 11 -fdeprecated- macro -fdebug-compilation-dir / Users / zacharykraus -ferror-limit 19 -fmessage-length 80 -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime = macosx-10.8.0 -fencode-extended-block-signature -fcxx -exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o /var/folders/k5/ywc_m0js3z3byh3yqwbfmfj00000gn/T/hash_methods-b28b1b.o -x c ++ / Users / zacharykraus / Desktop / kmap_testing / hash_methods。 cpp
clang -cc1版本5.1基于LLVM 3.4svn默认目标x86_64-apple-darwin12.5.0
忽略不存在的目录/ usr / include / c ++ / v1
#include.. 。搜索从这里开始:
#include< ...>搜索从这里开始:
/ Users / zacharykraus / Desktop / p_class_test
/ Users / zacharykraus / Thread_Pool
/ Users / zacharykraus / Desktop / kmap_testing
/usr/bin/../ lib / c ++ / v1
/ usr / local / include
/usr/bin/../lib/clang/5.1/include
/ usr / include
/ System / Library / Frameworks(框架目录)
/ Library / Frameworks(框架目录)
搜索列表的结尾。
/ usr / bin / clang-cc1 -triple x86_64-apple-macosx10.8.0 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name p_classtest.cpp -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 236.3 -v -resource-dir /usr/bin/../ lib / clang / 5.1 -I / Users / zacharykraus / Desktop / p_class_test / -I / Users / zacharykraus / Thread_Pool / -I / Users / zacharykraus / Desktop / kmap_testing / -stdlib = libc ++ -std = c ++ 11 -fdeprecated- macro -fdebug-compilation-dir / Users / zacharykraus -ferror-limit 19 -fmessage-length 80 -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime = macosx-10.8.0 -fencode-extended-block-signature -fcxx -exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o /var/folders/k5/ywc_m0js3z3byh3yqwbfmfj00000gn/T/p_classtest-ad56a5.o -x c ++ / Users / zacharykraus / Desktop / p_class_test / p_classtest。 cpp
clang -cc1版本5.1基于LLVM 3.4svn默认目标x86_64-apple-darwin12.5.0
忽略不存在的目录/ usr / include / c ++ / v1
#include.. 。搜索从这里开始:
#include< ...>搜索从这里开始:
/ Users / zacharykraus / Desktop / p_class_test
/ Users / zacharykraus / Thread_Pool
/ Users / zacharykraus / Desktop / kmap_testing
/usr/bin/../ lib / c ++ / v1
/ usr / local / include
/usr/bin/../lib/clang/5.1/include
/ usr / include
/ System / Library / Frameworks(框架目录)
/ Library / Frameworks(框架目录)
搜索列表的结尾。
/ usr / bin / clang-cc1 -triple x86_64-apple-macosx10.8.0 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name refmanager.cpp -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 236.3 -v -resource-dir /usr/bin/../ lib / clang / 5.1 -I / Users / zacharykraus / Desktop / p_class_test / -I / Users / zacharykraus / Thread_Pool / -I / Users / zacharykraus / Desktop / kmap_testing / -stdlib = libc ++ -std = c ++ 11 -fdeprecated- macro -fdebug-compilation-dir / Users / zacharykraus -ferror-limit 19 -fmessage-length 80 -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime = macosx-10.8.0 -fencode-extended-block-signature -fcxx -exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o /var/folders/k5/ywc_m0js3z3byh3yqwbfmfj00000gn/T/refmanager-d17474.o -x c ++ / Users / zacharykraus / Desktop / p_class_test / refmanager。 cpp
clang -cc1版本5.1基于LLVM 3.4svn默认目标x86_64-apple-darwin12.5.0
忽略不存在的目录/ usr / include / c ++ / v1
#include.. 。搜索从这里开始:
#include< ...>搜索从这里开始:
/ Users / zacharykraus / Desktop / p_class_test
/ Users / zacharykraus / Thread_Pool
/ Users / zacharykraus / Desktop / kmap_testing
/usr/bin/../ lib / c ++ / v1
/ usr / local / include
/usr/bin/../lib/clang/5.1/include
/ usr / include
/ System / Library / Frameworks(框架目录)
/ Library / Frameworks(框架目录)
搜索列表的结尾。
/ usr / bin / ld-demangle -dynamic -arch x86_64 -macosx_version_min 10.8.0 -o nork /var/folders/k5/ywc_m0js3z3byh3yqwbfmfj00000gn/T/thread_helper-57c077.o / var / folders / k5 / ywc_m0js3z3byh3yqwbfmfj00000gn / T / thread_pool-321d19.o /var/folders/k5/ywc_m0js3z3byh3yqwbfmfj00000gn/T/hash_methods-b28b1b.o /var/folders/k5/ywc_m0js3z3byh3yqwbfmfj00000gn/T/p_classtest-ad56a5.o的/ var /文件夹/ K5 / ywc_m0js3z3byh3yqwbfmfj00000gn / T / refmanager-d17474.o -lc ++ -lSystem /usr/bin/../lib/clang/5.1/lib/darwin/libclang_rt.osx.a

不幸的是我不能在终端中比较代码块g ++和g ++。



但是基于两个不同的编译在。。看来代码块在链接步骤期间不使用libc ++库。你怎么代码块使用正确的库上链接的铿锵++?



我假设基础上,铿锵问题G ++中的代码块甚至告诉时使用旧的C ++ 03库编译器切换到c ++ 11。但我不知道如何确认这一点。

解决方案

我发现clang ++的答案。



显然,你必须将-stdlib = libc ++添加为编译器标志和链接标志。



链接输出变为

  Apple LLVM版本5.1(clang-503.0.40)(基于LLVM 3.4svn)
目标:x86_64-apple-darwin12。 5.0
线程模型:posix
/ usr / bin / ld-demangle -dynamic -arch x86_64 -macosx_version_min 10.8.0 -o bin / Release / p_class_test obj / Release / Thread_Pool / thread_helper.o obj /Release/Thread_Pool/thread_pool.o obj / Release / Desktop / kmap_testing / hash_methods.o obj / Release / Desktop / p_class_test / p_classtest.o obj / Release / Desktop / p_class_test / refmanager.o -lc ++ -lSystem / usr / bin / ../lib/clang/5.1/lib/darwin/libclang_rt.osx.a

清楚地显示使用正确的库。



发生g ++问题的原因是,即使codeblocks输出它是编译g ++实际上使用clang ++库作为编译和链接过程的一部分。虽然基于输出不是100%清楚如果g ++编译器及其包括被调用。要解决这个问题,您需要为编译和链接添加-stdlib = libc ++标志。为了证明对苹果的代码块使用引擎盖下铛库其实,我附上链接和编译和代码块中使用的命令期间-v的输出。



以下是链接的信息:

  g ++ -o bin / Debug / p_class_test obj / Debug / Thread_Pool / thread_helper.o obj / Debug / Thread_Pool / thread_pool.o obj / Debug / Desktop / kmap_testing / hash_methods.o obj / Debug / Desktop / p_class_test / p_classtest.o obj / Debug / Desktop / p_class_test / refmanager.o -v -stdlib = libc ++ 
Apple LLVM版本5.1(clang-503.0.40)(基于LLVM 3.4svn)
目标:x86_64-apple-darwin12.5.0
线程模型:posix
/ Applications / Xcode 。应用程序/内容/开发商/工具链/ XcodeDefault.xctoolchain的/ usr / bin中/ LD-demangle -dynamic -arch x86_64的-macosx_version_min 10.8.0 -o斌/调试/ p_class_test OBJ /调试/ Thread_Pool / thread_helper.o OBJ /调试/Thread_Pool/thread_pool.o OBJ /调试/桌面/ kmap_testing / hash_methods.o OBJ /调试/桌面/ p_class_test / p_classtest.o OBJ /调试/桌面/ p_class_test / refmanager.o -lc ++ -lSystem /Applications/Xcode.app/内容/开发人员/工具链/ XcodeDefault.xctoolchain / usr / bin /../ lib / clang / 5.1 / lib / darwin / libclang_rt.osx.a

这里是编译的信息:

  g ++ -g -std = c ++ 11 -stdlib = libc ++ -v -I / Users / zacharykraus / Desktop / p_class_test / -I / Users / zacharykraus / Thread_Pool -I / Users / zacharykraus / Desktop / kmap_testing -c / Users / zacharykraus / Desktop / p_class_test / refmanager .cpp -o obj / Debug / Desktop / p_class_test / refmanager.o 
Apple LLVM版本5.1(clang-503.0.40)(基于LLVM 3.4svn)
目标:x86_64-apple-darwin12.5.0
线程模型:posix
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang-cc1 -triple x86_64-apple-macosx10.8.0 -emit- obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name refmanager.cpp -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -masm-verbose -munwind-tables-target -cpu core2 -target-linker-version 236.3 -v -gdwarf-2 -coverage-file /Users/zacharykraus/Desktop/p_class_test/obj/Debug/Desktop/p_class_test/refmanager.o -resource-dir /Applications/Xcode.app /Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.1 -I / Users / zacharykraus / Desktop / p_class_test / -I / Users / zacharykraus / Thread_Pool -I / Users / zacharykraus / Desktop / kmap_testing -stdlib = ++的libc -std = C ++ 11 -fdeprecated宏-fdebug编译-DIR /用户/ zacharykraus /桌面/ p_class_test -ferror限制19 -fmessage长度0 -stack-保护1 -mstackrealign -fblocks -fobjc-runtime = macosx-10.8.0 -fencode-extended-block-signature -fcxx-exceptions -fexceptions -fdiagnostics-show-option -vectorize-slp -o obj / Debug / Desktop / p_class_test / refmanager.o -x c ++ /Users/zacharykraus/Desktop/p_class_test/refmanager.cpp
铛基于LLVM 3.4svn缺省目标的x86_64-苹果darwin12.5.0
忽略不存在的目录-cc1 5.1版/ usr / include目录/ C ++ / v1
#include...搜索从这里开始:
#include< ...>搜索从这里开始:
/ Users / zacharykraus / Desktop / p_class_test
/ Users / zacharykraus / Thread_Pool
/ Users / zacharykraus / Desktop / kmap_testing
/Applications/Xcode.app/Contents /Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1
/ usr / local / include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault。 xctoolchain / usr / bin /../ lib / clang / 5.1 / include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
/ usr / include
/ System / Library / Frameworks(框架目录)
/ Library / Frameworks(框架目录)
搜索结束。

经过很多烦恼后,我终于找出了g ++对代码块的问题。问题是,调用g ++时,代码块不使用可执行路径。相反,它在编译器设置中使用您的工具链可执行路径。我的工具链可执行文件路径设置为/ usr / bin,g ++的apple版本位于该目录。这个版本实际上通过一系列复杂的调用调用clang ++。所有我需要做的来解决这个问题是将工具链可执行文件路径更改为/ usr / local / bin,其中我的实际gnu编译器驻留。在这个更改后,我能够摆脱-stdlib = libc ++,我的编译和链接读数如下。



编译:

  g ++ -g -std = c ++ 11 -v -I / Users / zacharykraus / Desktop / p_class_test / -I / Users / zacharykraus / Thread_Pool -I / Users / zacharykraus / Desktop / kmap_testing -c /Users/zacharykraus/Thread_Pool/thread_helper.cpp -o obj / Debug / Thread_Pool / thread_helper.o 
使用内置规格。
COLLECT_GCC = g ++
目标:x86_64-apple-darwin12.5.0
配置为:../gcc-4.8.1/configure --enable-languages = c ++,fortran
线程模型:posix
gcc version 4.8.1(GCC)
COLLECT_GCC_OPTIONS =' - mmacosx-version-min = 10.8.5''-g''-std = c ++ 11-v '-I''/ Users / zacharykraus / Desktop / p_class_test /''-I''/ Users / zacharykraus / Thread_Pool''-I''/ Users / zacharykraus / Desktop / kmap_testing''-c' 'obj / Debug / Thread_Pool / thread_helper.o''-shared-libgcc''-mtune = core2'
/usr/local/libexec/gcc/x86_64-apple-darwin12.5.0/4.8.1/cc1plus - 安静-v -I /用户/ zacharykraus /桌面/ p_class_test / -I /用户/ zacharykraus / Thread_Pool -I /用户/ zacharykraus /桌面/ kmap_testing -D__DYNAMIC__ /Users/zacharykraus/Thread_Pool/thread_helper.cpp -fPIC -feliminate未用-debug-symbols -quiet -dumpbase thread_helper.cpp -mmacosx-version-min = 10.8.5 -mtune = core2 -auxbase-strip obj / Debug / Thread_Pool / thread_helper.o -g -std = c ++ 11 -version - o /var/folders/k5/ywc_m0js3z3byh3yqwbfmfj00000gn/T//ccVidneY.s
GNU C版本4.8.1编译的GNU C ++(GCC)版本4.8.1(x86_64-apple-darwin12.5.0)
,GMP版本4.3.1,MPFR版本2.4.1,MPC版本0.8.1
GGC启发式:--param ggc-min-expand = 100 --param ggc-min-heapsize = 131072
忽略不存在目录/usr/local/lib/gcc/x86_64-apple-darwin12.5.0/4.8.1/../../../../x86_64-apple-darwin12.5.0/include
#include...搜索从这里开始:
#include< ...>搜索从这里开始:
/ Users / zacharykraus / Desktop / p_class_test /
/ Users / zacharykraus / Thread_Pool
/ Users / zacharykraus / Desktop / kmap_testing
/ usr / local / gcc / x86_64-apple-darwin12.5.0 / 4.8.1 /../../../../ include / c ++ / 4.8.1
/ usr / local / lib / gcc / x86_64-apple- darwin12.5.0 / 4.8.1 /../../../../ include / c ++ / 4.8.1 / x86_64-apple-darwin12.5.0
/ usr / local / lib / gcc / x86_64- apple-darwin12.5.0 / 4.8.1 /../../../../ include / c ++ / 4.8.1 / backward
/ usr / local / lib / gcc / x86_64-apple-darwin12。 5.0 / 4.8.1 / include
/ usr / local / include
/usr/local/lib/gcc/x86_64-apple-darwin12.5.0/4.8.1/include-fixed
/ usr / include
/ System / Library / Frameworks
/ Library / Frameworks
搜索结束。

链接:

 code> g ++ -o bin / Debug / p_class_test obj / Debug / Thread_Pool / thread_helper.o obj / Debug / Thread_Pool / thread_pool.o obj / Debug / Desktop / kmap_testing / hash_methods.o obj / Debug / Desktop / p_class_test / p_classtest.o obj / Debug / Desktop / p_class_test / refmanager.o -v 
使用内置specs。
COLLECT_GCC = g ++
COLLECT_LTO_WRAPPER = / usr / local / libexec / gcc / x86_64-apple-darwin12.5.0 / 4.8.1 / lto-wrapper
目标:x86_64-apple-darwin12.5.0
配置:../gcc-4.8.1/configure --enable-languages = c ++,fortran
线程模型:posix
gcc版本4.8.1(GCC)
COMPILER_PATH = / usr / local / libexec / gcc / x86_64-apple-darwin12.5.0 / 4.8.1 /:/ usr / local / libexec / gcc / x86_64-apple-darwin12.5.0 / 4.8.1 /:/ usr / local /libexec/gcc/x86_64-apple-darwin12.5.0/:/usr/local/lib/gcc/x86_64-apple-darwin12.5.0/4.8.1/:/usr/local/lib/gcc/x86_64-apple-darwin12 .5.0 /
LIBRARY_PATH = / usr / local / lib / gcc / x86_64-apple-darwin12.5.0 / 4.8.1 /:/ usr / local / lib / gcc / x86_64-apple-darwin12.5.0 / 1 /../../../:/ usr / lib /
COLLECT_GCC_OPTIONS =' - mmacosx-version-min = 10.8.5''-o''bin / Debug / p_class_test''-v' '-shared-libgcc''-mtune = core2'
/usr/local/libexec/gcc/x86_64-apple-darwin12.5.0/4.8.1/collect2 -dynamic -arch x86_64 -macosx_version_min 10.8.5 -weak_reference_mismatches非弱-o bin / Debug / p_class_test -L / usr / local / lib / gcc / x86_64-apple-darwin12.5.0 / 4.8.1 -L / usr / local / lib / gcc / x86_64-apple-darwin12.5.0 /4.8.1/../../... obj / Debug / Thread_Pool / thread_helper.o obj / Debug / Thread_Pool / thread_pool.o obj / Debug / Desktop / kmap_testing / hash_methods.o obj / Debug / Desktop / p_class_test / p_classtest.o obj / Debug / Desktop / p_class_test / refmanager.o -lstdc ++ -no_compact_unwind -lSystem -lgcc_ext.10.5 -lgcc -lSystem -v
collect2 version 4.8.1
/ usr / bin / ld - 动态-arch x86_64 -macosx_version_min 10.8.5 -weak_reference_mismatches非弱-o bin / Debug / p_class_test -L / usr / local / lib / gcc / x86_64-apple-darwin12.5.0 / 4.8.1 -L / usr / local / lib / gcc / x86_64-apple-darwin12.5.0 / 4.8.1 /../../ .. obj / Debug / Thread_Pool / thread_helper.o obj / Debug / Thread_Pool / thread_pool.o obj / Debug / Desktop / kmap_testing / hash_methods.o obj / Debug / Desktop / p_class_test / p_classtest.o obj / Debug / Desktop / p_class_test / refmanager.o -lstdc ++ -no_compact_unwind -lSystem -lgcc_ext.10.5 -lgcc -lSystem -v
@(#)PROGRAM :ld PROJECT:ld64-236.4
配置为支持archs:armv6 armv7 armv7s arm64 i386 x86_64 armv6m armv7m armv7em
库搜索路径:
/ usr / local / lib / gcc / x86_64-apple- darwin12.5.0 / 4.8.1
/ usr / local / lib
/ usr / lib
/ usr / local / lib
框架搜索路径:
/ Library /框架/
/ System / Library / Frameworks /


I cant seem to get codeblocks 13.12 to compile c++11 correctly in both clang++ and g++. I have attached the -std=c++11 and -stdlib=libc++ when compiling with clang++. This leads to a linking error. For g++ when you add -std=c++11 or -std=c++0x, the compiler cannot find the random header. When I compiled the code manually in a terminal using both clang++ and g++, none of these errors occurred.

The full linker errors are too long to post so i will just post the information given from the -v invocation. In codeblocks using clang++ with -std=c++11 and -stdlib=libc++:

Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin12.5.0
Thread model: posix
 "/usr/bin/ld" -demangle -dynamic -arch x86_64 -macosx_version_min 10.8.0 -o bin/Release/p_class_test obj/Release/Thread_Pool/thread_helper.o obj/Release/Thread_Pool/thread_pool.o obj/Release/Desktop/kmap_testing/hash_methods.o obj/Release/Desktop/p_class_test/p_classtest.o obj/Release/Desktop/p_class_test/refmanager.o -lstdc++ -lSystem /usr/bin/../lib/clang/5.1/lib/darwin/libclang_rt.osx.a

compiling in terminal using clang++ with -std=c++11 and -stdlib=libc++:

Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin12.5.0
Thread model: posix
 "/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.8.0 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name thread_helper.cpp -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 236.3 -v -resource-dir /usr/bin/../lib/clang/5.1 -I /Users/zacharykraus/Desktop/p_class_test/ -I /Users/zacharykraus/Thread_Pool/ -I /Users/zacharykraus/Desktop/kmap_testing/ -stdlib=libc++ -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /Users/zacharykraus -ferror-limit 19 -fmessage-length 80 -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime=macosx-10.8.0 -fencode-extended-block-signature -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o /var/folders/k5/ywc_m0js3z3byh3yqwbfmfj00000gn/T/thread_helper-57c077.o -x c++ /Users/zacharykraus/Thread_Pool/thread_helper.cpp
clang -cc1 version 5.1 based upon LLVM 3.4svn default target x86_64-apple-darwin12.5.0
ignoring nonexistent directory "/usr/include/c++/v1"
#include "..." search starts here:
#include <...> search starts here:
 /Users/zacharykraus/Desktop/p_class_test
 /Users/zacharykraus/Thread_Pool
 /Users/zacharykraus/Desktop/kmap_testing
 /usr/bin/../lib/c++/v1
 /usr/local/include
 /usr/bin/../lib/clang/5.1/include
 /usr/include
 /System/Library/Frameworks (framework directory)
 /Library/Frameworks (framework directory)
End of search list.
 "/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.8.0 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name thread_pool.cpp -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 236.3 -v -resource-dir /usr/bin/../lib/clang/5.1 -I /Users/zacharykraus/Desktop/p_class_test/ -I /Users/zacharykraus/Thread_Pool/ -I /Users/zacharykraus/Desktop/kmap_testing/ -stdlib=libc++ -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /Users/zacharykraus -ferror-limit 19 -fmessage-length 80 -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime=macosx-10.8.0 -fencode-extended-block-signature -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o /var/folders/k5/ywc_m0js3z3byh3yqwbfmfj00000gn/T/thread_pool-321d19.o -x c++ /Users/zacharykraus/Thread_Pool/thread_pool.cpp
clang -cc1 version 5.1 based upon LLVM 3.4svn default target x86_64-apple-darwin12.5.0
ignoring nonexistent directory "/usr/include/c++/v1"
#include "..." search starts here:
#include <...> search starts here:
 /Users/zacharykraus/Desktop/p_class_test
 /Users/zacharykraus/Thread_Pool
 /Users/zacharykraus/Desktop/kmap_testing
 /usr/bin/../lib/c++/v1
 /usr/local/include
 /usr/bin/../lib/clang/5.1/include
 /usr/include
 /System/Library/Frameworks (framework directory)
 /Library/Frameworks (framework directory)
End of search list.
 "/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.8.0 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name hash_methods.cpp -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 236.3 -v -resource-dir /usr/bin/../lib/clang/5.1 -I /Users/zacharykraus/Desktop/p_class_test/ -I /Users/zacharykraus/Thread_Pool/ -I /Users/zacharykraus/Desktop/kmap_testing/ -stdlib=libc++ -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /Users/zacharykraus -ferror-limit 19 -fmessage-length 80 -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime=macosx-10.8.0 -fencode-extended-block-signature -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o /var/folders/k5/ywc_m0js3z3byh3yqwbfmfj00000gn/T/hash_methods-b28b1b.o -x c++ /Users/zacharykraus/Desktop/kmap_testing/hash_methods.cpp
clang -cc1 version 5.1 based upon LLVM 3.4svn default target x86_64-apple-darwin12.5.0
ignoring nonexistent directory "/usr/include/c++/v1"
#include "..." search starts here:
#include <...> search starts here:
 /Users/zacharykraus/Desktop/p_class_test
 /Users/zacharykraus/Thread_Pool
 /Users/zacharykraus/Desktop/kmap_testing
 /usr/bin/../lib/c++/v1
 /usr/local/include
 /usr/bin/../lib/clang/5.1/include
 /usr/include
 /System/Library/Frameworks (framework directory)
 /Library/Frameworks (framework directory)
End of search list.
 "/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.8.0 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name p_classtest.cpp -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 236.3 -v -resource-dir /usr/bin/../lib/clang/5.1 -I /Users/zacharykraus/Desktop/p_class_test/ -I /Users/zacharykraus/Thread_Pool/ -I /Users/zacharykraus/Desktop/kmap_testing/ -stdlib=libc++ -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /Users/zacharykraus -ferror-limit 19 -fmessage-length 80 -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime=macosx-10.8.0 -fencode-extended-block-signature -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o /var/folders/k5/ywc_m0js3z3byh3yqwbfmfj00000gn/T/p_classtest-ad56a5.o -x c++ /Users/zacharykraus/Desktop/p_class_test/p_classtest.cpp
clang -cc1 version 5.1 based upon LLVM 3.4svn default target x86_64-apple-darwin12.5.0
ignoring nonexistent directory "/usr/include/c++/v1"
#include "..." search starts here:
#include <...> search starts here:
 /Users/zacharykraus/Desktop/p_class_test
 /Users/zacharykraus/Thread_Pool
 /Users/zacharykraus/Desktop/kmap_testing
 /usr/bin/../lib/c++/v1
 /usr/local/include
 /usr/bin/../lib/clang/5.1/include
 /usr/include
 /System/Library/Frameworks (framework directory)
 /Library/Frameworks (framework directory)
End of search list.
 "/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.8.0 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name refmanager.cpp -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 236.3 -v -resource-dir /usr/bin/../lib/clang/5.1 -I /Users/zacharykraus/Desktop/p_class_test/ -I /Users/zacharykraus/Thread_Pool/ -I /Users/zacharykraus/Desktop/kmap_testing/ -stdlib=libc++ -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /Users/zacharykraus -ferror-limit 19 -fmessage-length 80 -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime=macosx-10.8.0 -fencode-extended-block-signature -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o /var/folders/k5/ywc_m0js3z3byh3yqwbfmfj00000gn/T/refmanager-d17474.o -x c++ /Users/zacharykraus/Desktop/p_class_test/refmanager.cpp
clang -cc1 version 5.1 based upon LLVM 3.4svn default target x86_64-apple-darwin12.5.0
ignoring nonexistent directory "/usr/include/c++/v1"
#include "..." search starts here:
#include <...> search starts here:
 /Users/zacharykraus/Desktop/p_class_test
 /Users/zacharykraus/Thread_Pool
 /Users/zacharykraus/Desktop/kmap_testing
 /usr/bin/../lib/c++/v1
 /usr/local/include
 /usr/bin/../lib/clang/5.1/include
 /usr/include
 /System/Library/Frameworks (framework directory)
 /Library/Frameworks (framework directory)
End of search list.
 "/usr/bin/ld" -demangle -dynamic -arch x86_64 -macosx_version_min 10.8.0 -o nork /var/folders/k5/ywc_m0js3z3byh3yqwbfmfj00000gn/T/thread_helper-57c077.o /var/folders/k5/ywc_m0js3z3byh3yqwbfmfj00000gn/T/thread_pool-321d19.o /var/folders/k5/ywc_m0js3z3byh3yqwbfmfj00000gn/T/hash_methods-b28b1b.o /var/folders/k5/ywc_m0js3z3byh3yqwbfmfj00000gn/T/p_classtest-ad56a5.o /var/folders/k5/ywc_m0js3z3byh3yqwbfmfj00000gn/T/refmanager-d17474.o -lc++ -lSystem /usr/bin/../lib/clang/5.1/lib/darwin/libclang_rt.osx.a

Unfortunately I cant make the comparison between codeblocks g++ and g++ in the terminal.

But based on the output from the two different compilations in clang. It appears codeblocks is not using the libc++ library during the linking step. How do you get codeblocks to use the correct libraries on linking for clang++?

I assume based on the clang problem g++ in codeblocks is using an older c++ 03 library even when telling the compiler to switch to c++11. But unfortunately I dont know how to confirm this.

解决方案

I found the answer to clang++.

Apparently you have to add -stdlib=libc++ as both a compiler flag and a linking flag.

The linkage output turns to

Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin12.5.0
Thread model: posix
 "/usr/bin/ld" -demangle -dynamic -arch x86_64 -macosx_version_min 10.8.0 -o bin/Release/p_class_test obj/Release/Thread_Pool/thread_helper.o obj/Release/Thread_Pool/thread_pool.o obj/Release/Desktop/kmap_testing/hash_methods.o obj/Release/Desktop/p_class_test/p_classtest.o obj/Release/Desktop/p_class_test/refmanager.o -lc++ -lSystem /usr/bin/../lib/clang/5.1/lib/darwin/libclang_rt.osx.a

which clearly shows the correct library being used.

The g++ problem occurs because even though codeblocks outputs that is it compiling with g++ in actually it using clang++ libraries as part of the compilation and linking process. Though based on the output its not 100% clear if the g++ compiler and its includes are being called. To fix the problem, you need to add -stdlib=libc++ flag for both compilation and linking. As proof that codeblocks on apple is in fact using the clang libraries under the hood, I have attached the output from -v during both linking and compiling and the commands used by codeblocks.

Here is the information for linking:

g++  -o bin/Debug/p_class_test obj/Debug/Thread_Pool/thread_helper.o obj/Debug/Thread_Pool/thread_pool.o obj/Debug/Desktop/kmap_testing/hash_methods.o obj/Debug/Desktop/p_class_test/p_classtest.o obj/Debug/Desktop/p_class_test/refmanager.o  -v -stdlib=libc++
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin12.5.0
Thread model: posix
 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -dynamic -arch x86_64 -macosx_version_min 10.8.0 -o bin/Debug/p_class_test obj/Debug/Thread_Pool/thread_helper.o obj/Debug/Thread_Pool/thread_pool.o obj/Debug/Desktop/kmap_testing/hash_methods.o obj/Debug/Desktop/p_class_test/p_classtest.o obj/Debug/Desktop/p_class_test/refmanager.o -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.1/lib/darwin/libclang_rt.osx.a

And here is the information for compiling:

g++ -g -std=c++11 -stdlib=libc++ -v -I/Users/zacharykraus/Desktop/p_class_test/ -I/Users/zacharykraus/Thread_Pool -I/Users/zacharykraus/Desktop/kmap_testing -c /Users/zacharykraus/Desktop/p_class_test/refmanager.cpp -o obj/Debug/Desktop/p_class_test/refmanager.o
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin12.5.0
Thread model: posix
 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.8.0 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name refmanager.cpp -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 236.3 -v -gdwarf-2 -coverage-file /Users/zacharykraus/Desktop/p_class_test/obj/Debug/Desktop/p_class_test/refmanager.o -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.1 -I /Users/zacharykraus/Desktop/p_class_test/ -I /Users/zacharykraus/Thread_Pool -I /Users/zacharykraus/Desktop/kmap_testing -stdlib=libc++ -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /Users/zacharykraus/Desktop/p_class_test -ferror-limit 19 -fmessage-length 0 -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime=macosx-10.8.0 -fencode-extended-block-signature -fcxx-exceptions -fexceptions -fdiagnostics-show-option -vectorize-slp -o obj/Debug/Desktop/p_class_test/refmanager.o -x c++ /Users/zacharykraus/Desktop/p_class_test/refmanager.cpp
clang -cc1 version 5.1 based upon LLVM 3.4svn default target x86_64-apple-darwin12.5.0
ignoring nonexistent directory "/usr/include/c++/v1"
#include "..." search starts here:
#include <...> search starts here:
 /Users/zacharykraus/Desktop/p_class_test
 /Users/zacharykraus/Thread_Pool
 /Users/zacharykraus/Desktop/kmap_testing
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1
 /usr/local/include
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.1/include
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
 /usr/include
 /System/Library/Frameworks (framework directory)
 /Library/Frameworks (framework directory)
End of search list.

After a lot of annoyance I finally figured out what the problem with g++ was on codeblocks. The problem is that codeblocks when calling g++ does not use your executable path. Instead it uses your toolchain executable path in the Compiler settings. My toolchain executable path was set to /usr/bin where the apple version of g++ resides. This version actually calls clang++ through a complex series of calls. All I needed to do to fix the issue was to change the toolchain executable path to /usr/local/bin where my actual gnu compiler resides. After this change, I was able to get rid of -stdlib=libc++ and my compilation and linking readouts are below.

compilation:

g++ -g -std=c++11 -v -I/Users/zacharykraus/Desktop/p_class_test/ -I/Users/zacharykraus/Thread_Pool -I/Users/zacharykraus/Desktop/kmap_testing -c /Users/zacharykraus/Thread_Pool/thread_helper.cpp -o obj/Debug/Thread_Pool/thread_helper.o
Using built-in specs.
COLLECT_GCC=g++
Target: x86_64-apple-darwin12.5.0
Configured with: ../gcc-4.8.1/configure --enable-languages=c++,fortran
Thread model: posix
gcc version 4.8.1 (GCC) 
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.8.5' '-g' '-std=c++11' '-v' '-I' '/Users/zacharykraus/Desktop/p_class_test/' '-I' '/Users/zacharykraus/Thread_Pool' '-I' '/Users/zacharykraus/Desktop/kmap_testing' '-c' '-o' 'obj/Debug/Thread_Pool/thread_helper.o' '-shared-libgcc' '-mtune=core2'
 /usr/local/libexec/gcc/x86_64-apple-darwin12.5.0/4.8.1/cc1plus -quiet -v -I /Users/zacharykraus/Desktop/p_class_test/ -I /Users/zacharykraus/Thread_Pool -I /Users/zacharykraus/Desktop/kmap_testing -D__DYNAMIC__ /Users/zacharykraus/Thread_Pool/thread_helper.cpp -fPIC -feliminate-unused-debug-symbols -quiet -dumpbase thread_helper.cpp -mmacosx-version-min=10.8.5 -mtune=core2 -auxbase-strip obj/Debug/Thread_Pool/thread_helper.o -g -std=c++11 -version -o /var/folders/k5/ywc_m0js3z3byh3yqwbfmfj00000gn/T//ccVidneY.s
GNU C++ (GCC) version 4.8.1 (x86_64-apple-darwin12.5.0)
    compiled by GNU C version 4.8.1, GMP version 4.3.1, MPFR version 2.4.1, MPC version 0.8.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/lib/gcc/x86_64-apple-darwin12.5.0/4.8.1/../../../../x86_64-apple-darwin12.5.0/include"
#include "..." search starts here:
#include <...> search starts here:
 /Users/zacharykraus/Desktop/p_class_test/
 /Users/zacharykraus/Thread_Pool
 /Users/zacharykraus/Desktop/kmap_testing
 /usr/local/lib/gcc/x86_64-apple-darwin12.5.0/4.8.1/../../../../include/c++/4.8.1
 /usr/local/lib/gcc/x86_64-apple-darwin12.5.0/4.8.1/../../../../include/c++/4.8.1/x86_64-apple-darwin12.5.0
 /usr/local/lib/gcc/x86_64-apple-darwin12.5.0/4.8.1/../../../../include/c++/4.8.1/backward
 /usr/local/lib/gcc/x86_64-apple-darwin12.5.0/4.8.1/include
 /usr/local/include
 /usr/local/lib/gcc/x86_64-apple-darwin12.5.0/4.8.1/include-fixed
 /usr/include
 /System/Library/Frameworks
 /Library/Frameworks
End of search list.

linking:

g++  -o bin/Debug/p_class_test obj/Debug/Thread_Pool/thread_helper.o obj/Debug/Thread_Pool/thread_pool.o obj/Debug/Desktop/kmap_testing/hash_methods.o obj/Debug/Desktop/p_class_test/p_classtest.o obj/Debug/Desktop/p_class_test/refmanager.o  -v  
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-apple-darwin12.5.0/4.8.1/lto-wrapper
Target: x86_64-apple-darwin12.5.0
Configured with: ../gcc-4.8.1/configure --enable-languages=c++,fortran
Thread model: posix
gcc version 4.8.1 (GCC) 
COMPILER_PATH=/usr/local/libexec/gcc/x86_64-apple-darwin12.5.0/4.8.1/:/usr/local/libexec/gcc/x86_64-apple-darwin12.5.0/4.8.1/:/usr/local/libexec/gcc/x86_64-apple-darwin12.5.0/:/usr/local/lib/gcc/x86_64-apple-darwin12.5.0/4.8.1/:/usr/local/lib/gcc/x86_64-apple-darwin12.5.0/
LIBRARY_PATH=/usr/local/lib/gcc/x86_64-apple-darwin12.5.0/4.8.1/:/usr/local/lib/gcc/x86_64-apple-darwin12.5.0/4.8.1/../../../:/usr/lib/
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.8.5' '-o' 'bin/Debug/p_class_test' '-v' '-shared-libgcc' '-mtune=core2'
 /usr/local/libexec/gcc/x86_64-apple-darwin12.5.0/4.8.1/collect2 -dynamic -arch x86_64 -macosx_version_min 10.8.5 -weak_reference_mismatches non-weak -o bin/Debug/p_class_test -L/usr/local/lib/gcc/x86_64-apple-darwin12.5.0/4.8.1 -L/usr/local/lib/gcc/x86_64-apple-darwin12.5.0/4.8.1/../../.. obj/Debug/Thread_Pool/thread_helper.o obj/Debug/Thread_Pool/thread_pool.o obj/Debug/Desktop/kmap_testing/hash_methods.o obj/Debug/Desktop/p_class_test/p_classtest.o obj/Debug/Desktop/p_class_test/refmanager.o -lstdc++ -no_compact_unwind -lSystem -lgcc_ext.10.5 -lgcc -lSystem -v
collect2 version 4.8.1
/usr/bin/ld -dynamic -arch x86_64 -macosx_version_min 10.8.5 -weak_reference_mismatches non-weak -o bin/Debug/p_class_test -L/usr/local/lib/gcc/x86_64-apple-darwin12.5.0/4.8.1 -L/usr/local/lib/gcc/x86_64-apple-darwin12.5.0/4.8.1/../../.. obj/Debug/Thread_Pool/thread_helper.o obj/Debug/Thread_Pool/thread_pool.o obj/Debug/Desktop/kmap_testing/hash_methods.o obj/Debug/Desktop/p_class_test/p_classtest.o obj/Debug/Desktop/p_class_test/refmanager.o -lstdc++ -no_compact_unwind -lSystem -lgcc_ext.10.5 -lgcc -lSystem -v
@(#)PROGRAM:ld  PROJECT:ld64-236.4
configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 armv6m armv7m armv7em
Library search paths:
    /usr/local/lib/gcc/x86_64-apple-darwin12.5.0/4.8.1
    /usr/local/lib
    /usr/lib
    /usr/local/lib
Framework search paths:
    /Library/Frameworks/
    /System/Library/Frameworks/

这篇关于C ++ 11在代码块中的编译问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆