0

I'm trying to build the libdepixelize library , but I'm getting the following error:

[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

I'm using clang with libstdc++ as compiler. GCC didn't work either.

EDIT: I used this in the CMakeLists file: set(CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++") and then did cmake -DCMAKE_CXX_COMPILER="clang++" .. and make to compile it. The full log is here: https://hastebin.com/axasololuc.js

I have no idea what exactly it means, or even how to fix it.

jww
  • 97,681
  • 90
  • 411
  • 885
Scayze
  • 75
  • 1
  • 10
  • I'm voting to close this question as off-topic because this is not a real programming question. If you are a developer of this library, please present a [mcve]. Otherwise, please read the library's documentation or file a bug report. – Baum mit Augen Feb 28 '17 at 00:41
  • Need to see your commandline. You may have the libstdc++ listed before the stuff that needs it. – user4581301 Feb 28 '17 at 00:42
  • @user4581301 i used this in the CMakeLists file: set(CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++") and then did ``cmake -DCMAKE_CXX_COMPILER="clang++" ..`` and ``make`` to compiler it. The full log is here: https://hastebin.com/axasololuc.js – Scayze Feb 28 '17 at 00:49
  • Update your clang version. Clang don't support GCC dual ABI before the 3.8 version I think. – Guillaume Racicot Feb 28 '17 at 01:10
  • 1
    Possible duplicate of [What is an undefined reference/unresolved external symbol error and how do I fix it?](https://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – Mike Kinghan Dec 09 '18 at 07:51
  • Please post the output from `make VERBOSE=1`. CMake hides useful information without it. For example, instead of showing your link command, CMake only shows *`Linking CXX executable depixelize-kopf2011`*. Derp... – jww Dec 09 '18 at 08:04

0 Answers0