Boost logo

Boost-Build :

From: Wieger Wesselink (wieger_at_[hidden])
Date: 2005-07-20 13:39:23


A colleague of mine has the following problem:

I seem to have a problem with combining static and shared linking of
system libraries. I use the following command line:

bjam --v2 gcc release link=static runtime-link=static

In combination with the following jamfile fragment:

exe dnavis :
Main.cxx
tools//dnavis_tools
IO//dnavis_io
render//dnavis_render
GUI//dnavis_gui
/site-config//fltk_gl
/site-config//fltk
/site-config//xerces-c/<link>shared
/site-config//flu
/site-config//flu_gl
/site-config//fltk_images
/site-config//png
/site-config//jpeg
/site-config//z
/site-config//GLU
/site-config//GL/<link>shared
/site-config//m
/site-config//Xext
/site-config//X11

Two of the system libraries are not available as static libraries, so
I require them to be linked dynamically. However, linking fails with
the message that the GL library (one of the two) can not be found. On
inspection of the linker commandline it seems that nothing is done to
link with the shared version of the GL library, so this was bound to fail.

"g++" -L"/opt/fltk/lib" -L"/opt/flu/lib" -L"/usr/X11R6/lib" -o
"bin/gcc/release/link-static/runtime-link-static/dnavis"
"bin/gcc/release/link-static/runtime-link-static/Main.o"
"GUI/bin/gcc/release/link-static/runtime-link-static/libdnavis_gui.a"
"render/bin/gcc/release/link-static/runtime-link-static/libdnavis_render.a"
"IO/bin/gcc/release/link-static/runtime-link-static/libdnavis_io.a"
"tools/bin/gcc/release/link-static/runtime-link-static/libdnavis_tools.a"
-lX11 -lXext -lm -lGLU -lz -ljpeg -lpng -lfltk_images -lflu_gl -lflu
-lfltk -lfltk_gl -lGL -lxerces-c -static -Wl,--strip-all

Does anybody know what I should do to make this work.

BTW without 'runtime-link=static' bjam does the job perfectly, but all
system libraries are shared.

 


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk