c++ - Why are libraries not found, even though they are clearly on the -L path? -


i have following linking command (sorry it's length, tried leave original possible, except shortening paths):

cc
cmakefiles/main.dir/main.cpp.o -o main -l/me/libs/cgal/lib -l/me/libs/tbb/tbb-2017_u7/build/linux_intel64_gcc_cc5.3.0_libc2.19_kernel3.12.61_release -rdynamic -lmpfr -lgmp /me/libs/cgal/lib/libcgal_imageio.a /me/libs/cgal/lib/libcgal.a -lboost_thread -lboost_system -lz /me/libs/cgal/lib/libcgal_imageio.a /me/libs/cgal/lib/libcgal.a -lboost_thread -lboost_system -lz -ltbb -ltbbmalloc -wl,-rpath,/me/libs/cgal/lib:/me/libs/tbb/tbb-2017_u7/build/linux_intel64_gcc_cc5.3.0_libc2.19_kernel3.12.61_release

it tell me:

/usr/bin/ld: cannot find -ltbb

/usr/bin/ld: cannot find -ltbbmalloc

most relevant problem have -l/me/libs/tbb/tbb-2017_u7/build/linux_intel64_gcc_cc5.3.0_libc2.19_kernel3.12.61_release , -ltbb - ltbbmalloc. in -l directory, there libtbb.so , libtbbmalloc.so.

but why libraries not found linker, though exist in directory given -l?

edit1: asked check file command. following answers:

  • the *.o file elf 64-bit lsb relocatable, x86-64, version 1 (gnu/linux), not stripped
  • the libtbb.so.2 elf 64-bit lsb shared object, x86-64, version 1 (sysv), dynamically linked, not stripped

seems not same, have no idea whether it's compatible. basically, compiled same compiler. i'm not sure whether build system of tbb might have sneaked in other options.

edit2: asked use strace. short excerpt shows:

open("/me/libs/tbb/tbb-2017_u7/build/linux_intel64_cc_cc5.3.0_libc2.19_kernel3.12.61_release/libtbb.so", o_rdonly) = 12 [pid 102330] open("/me/libs/tbb/tbb-2017_u7/build/linux_intel64_cc_cc5.3.0_libc2.19_kernel3.12.61_release/libtbb.so", o_rdonly) = 11 [pid 102330] open("libtbb.so.2", o_rdonly) = -1 enoent (no such file or directory) [pid 102330] open("/me/libs/cgal/lib/libtbb.so.2", o_rdonly) = -1 enoent (no such file or directory) [pid 102330] open("/me/libs/tbb/tbb-2017_u7/build/linux_intel64_cc_cc5.3.0_libc2.19_kernel3.12.61_release/libtbb.so.2", o_rdonly) = 11 

it seems checks files , finds 1 looking for.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -