[CMake] Linking problem

Brandon Van Every bvanevery at gmail.com
Wed Nov 7 03:46:35 EST 2007


On Nov 7, 2007 2:12 AM, Salvatore Iovene
<salvatore.iovene+cmake at googlemail.com> wrote:
> Hi,
> I'm not 100% sure this is really a CMake related question, but I'll
> fire it up anyway:
>
> I'm building a series of static libraries, name them liba.a, libb.a
> and libc.a, and linking them into a shared library libfoo.so.
>
> Then I'm building libx.a liby.a and libz.a and linking them into the
> shared libbar.so.
>
> Then I have an executable whatever.exe that's linked to to libfoo.so
> and libbar.so. The linking of the executable fails complaining of
> certain missing simbols. Some symbols from liba.a are missing in
> libbar.so.

I'm not a linking expert, but why should static symbols that you
embedded in libfoo.so be visible to libbar.so?

> So far I have "fixed" the issue by linking one of the libs of
> libfoo.so (say libx.a) to libbar.so. But this smells of nasy
> workaround.

Why should it be?  You're saying you really don't want those
underlying static libs to know about each other.  If you want symbols
from "a" to be visible to everyone, you should be making it a dynamic
liba.so.


Cheers,
Brandon Van Every


More information about the CMake mailing list