A
A
Andrey2015-07-03 15:02:39
FreeBSD
Andrey, 2015-07-03 15:02:39

OSRM compilation error: /usr/bin/ld: cannot find -lc++. How to overcome?

Good day!
I'm trying to build OSRM under FreeBSD 9.3, but it still doesn't work. Ultimately, when I do cmake, the following happens:

/usr/bin/clang++ -stdlib=libc++ -I/usr/local/include/c++/v1/tr1
  -L/usr/local/lib/c++ -v
  CMakeFiles/cmTryCompileExec2359982921.dir/testCXXCompiler.cxx.o -o
  cmTryCompileExec2359982921

   "/usr/bin/ld" --eh-frame-hdr -dynamic-linker /libexec/ld-elf.so.1 --hash-style=both --enable-new-dtags -o cmTryCompileExec2359982921 /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o -L/usr/local/lib/c++ -L/usr/lib CMakeFiles/cmTryCompileExec2359982921.dir/testCXXCompiler.cxx.o -lc++ -lm -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/crtend.o /usr/lib/crtn.o

  /usr/bin/ld: cannot find -lc++

[email protected]:/home/Project-OSRM/build # uname -a
FreeBSD BSD-san-2 9.3-RELEASE FreeBSD 9.3-RELEASE #0 r268512: Thu Jul 10 23:44:39 UTC 2014     [email protected]:/usr/obj/usr/src/sys/GENERIC  amd64
[email protected]:/home/Project-OSRM/build # clang++ -v
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
Target: x86_64-unknown-freebsd9.3
Thread model: posix
Selected GCC installation: 
[email protected]:/home/Project-OSRM/build # pkg info libc++
libc++-208080
Name           : libc++
Version        : 208080
Installed on   : Thu Jul  2 12:01:57 OMST 2015
Origin         : devel/libc++
Architecture   : freebsd:9:x86:64
Prefix         : /usr/local
Categories     : devel
Licenses       : 
Maintainer     : [email protected]
WWW            : http://libcxx.llvm.org/
Comment        : LLVM C++ standard library with c++11 support
Shared Libs required:
       libcxxrt.so
Shared Libs provided:
       libc++.so.1
Annotations    :
Flat size      : 7.56MiB
Description    :
libc++ is a new implementation of the C++ standard library made by the 
llvm project targeting C++11.

WWW: http://libcxx.llvm.org/

I'm trying to compile like this:
cmake .. -DCMAKE_CXX_COMPILER_ID=Clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_FLAGS='-stdlib=libc++ -I/usr/local/include/c++/v1/tr1 -L/usr/local/lib/c++ -v'

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question