[CMake] Linking issue under swig

gga ggarra at advancedsl.com.ar
Thu Apr 12 06:41:33 EDT 2007


I'm using cmake with swig to wrap several libraries into different
modules (currently under Linux).

The modules are inter-related.  That is, there's a swig base module that
needs to be loaded before the derived modules are and there are classes
in the derived module that inherit from the base module.

My problem is that the derived module crashes and burns upon running,
due to a dynamic_cast failing within the swig code.

After a lot of hair pulling and doing a simple test-suite, I found out
that the culprit is cmake's command-line options.  Particularly the
linking with:
  -Wl,-Bsymbolic

When that is removed from the linking of the derived module, all works
fine and the dynamic casts succeed.

Now, my two questions are:
	a) Where is -Wl,Bsymbolic being defined?  I seem not to be able to
locate it in any of the modules.  Is there any way to turn it off?  By
default g++ seems to compile with that off.

        b) Looking at the ld manual, I'll admit I'm not too clear on
what that option actually does.  Or how to go around debugging what
symbol is the one not being bound properly.  Anyone can explain help?
Perhaps also changing the visibility of some extern declaration may also
solve the issue.




-- 
Gonzalo Garramuño
ggarra at advancedsl.com.ar

AMD4400 - ASUS48N-E
GeForce7300GT
Kubuntu Edgy


More information about the CMake mailing list