使用clang

时间:2017-02-28 00:34:54

标签: c++ linker clang linker-errors

我正在尝试构建libdepixelize库,但我收到以下错误:

[100%] Linking CXX executable depixelize-kopf2011
/usr/bin/ld: /usr/local/lib/lib2geom.a(nearest-point.o): undefined reference to symbol '_ZNKSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEE3strEv@@GLIBCXX_3.4.21'
//usr/lib/x86_64-linux-gnu/libstdc++.so.6: error adding symbols: DSO missing from command line
clang: error: linker command failed with exit code 1 (use -v to see invocation)
src/depixelize-kopf2011/CMakeFiles/depixelize-kopf2011.dir/build.make:95: recipe for target 'src/depixelize-kopf2011/depixelize-kopf2011' failed
make[2]: *** [src/depixelize-kopf2011/depixelize-kopf2011] Error 1
CMakeFiles/Makefile2:142: recipe for target 'src/depixelize-kopf2011/CMakeFiles/depixelize-kopf2011.dir/all' failed
make[1]: *** [src/depixelize-kopf2011/CMakeFiles/depixelize-kopf2011.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

我使用clang和libstdc++作为编译器。海湾合作委员会也没有工作。

编辑:我在CMakeLists文件中使用了这个:set(CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++"),然后cmake -DCMAKE_CXX_COMPILER="clang++" ..make进行编译。完整日志位于:https://hastebin.com/axasololuc.js

我不知道它究竟意味着什么,甚至不知道如何解决它。

0 个答案:

没有答案