Skip to content
Advertisement

cmake linking shared libraries on ubuntu

Hi I am having problems with linking two libraries on ubuntu using cmake 2.8.12

Directory structure

JavaScript

CMakeLists.txt for lib1

JavaScript

This builds fine.

Then for lib2 I have the following CMakeLists.txt

JavaScript

Here I get

Linking CXX shared library ../build/liblib2.so

/usr/bin/ld: cannot find -llib1

I am not clear how to correctly link these two shared libraries using CMake. Anyone an idea what is going wrong.

Cheers, Mike

Advertisement

Answer

1) If you use

JavaScript

why do you think you need

JavaScript

?

2) Try this:

JavaScript

and see what happens.

3) See http://www.cmake.org/cmake/help/v3.0/manual/cmake-packages.7.html

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement