I have following CMakeLists.txt:
set( PROJECT_LINK_LIBS lib1.so lib2.so )
link_directories( path/to/libs ) # lib1.so and lib2.so are there.
add_library( ${PROJECT_NAME} SHARED ${PROJECT_SOURCES} )
target_link_libraries( ${PROJECT_NAME} ${PROJECT_LINK_LIBS} )
Which compiles and links fine.
But when I do:
ldd -d mylib.so
I get:
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf529b000)
linux-gate.so.1 => (0xf777a000)
/lib/ld-linux.so.2 (0xf777b000)
lib1.so => /path/to/libs/lib1.so (0xf56a2000)
lib2.so => /path/to/libs/lib2.so (0xf548f000)
My questions are:
- How to remove /path/to/libs/ for 4. and 5.? Something to do with LD_LIBRARY_PATH?
- Auto-answered: I get what means 1. Search for libc.so.6 in that path. But what about 2. and 3.?
locate linux-gate.so.1
gives nothing. Why 3. has no => symbol? (found answer here)