Question about static linking of boost
Thanks to Stephen for helping me get my boost to link. I feel bad for not thinking of this solution myself. I have one final question/suggestion about the getting started document (which I found to be very well written). I compile and install boost using the following command: tools/build/jam_src/bin.linuxx86/bjam "-sTOOLS=gcc" "-sBUILD=release <runtime-link>static" --prefix=$HOME/linux/lib/boost install My goal was to create a minimal set of boost libraries (basically, I just need the filesystem non-debug static version. I was surprised to find that the above command installs shared libraries for some of the libraries, and it also installs both the -s- version of the static libraries and the -sd- version. It seems to me that this might be a bug, since I specifically requested only the release version. Am I confused about the difference between release version and debug version? Also, I am confused about the meaning of the -s- flag in the runtime section of the filename. Why do we get libraries that are shared but have the -s- flag? That seems like a contradiction. Similarly, if I don't specify static linking using the -sBUILD option (I assume the absence of the -s- flag means dynamic implicitly), I still get static libraries (i.e. .a extension files). These files seem to be unusable more or less (when I try to link against them, the compiler uses the shared libraries instead even if they don't exist). Anyway, all this is not much use to me, since I have it working now, but maybe someone could add a bit of text to the getting started document explaining this. Also, it might be helpful to give an example compile command that shows linking in the boost libraries. Thanks again for all your help. Sincerely, Daniel
Daniel Huber
Thanks to Stephen for helping me get my boost to link. I feel bad for not thinking of this solution myself.
I have one final question/suggestion about the getting started document (which I found to be very well written).
I compile and install boost using the following command:
tools/build/jam_src/bin.linuxx86/bjam "-sTOOLS=gcc" "-sBUILD=release <runtime-link>static" --prefix=$HOME/linux/lib/boost install
My goal was to create a minimal set of boost libraries (basically, I just need the filesystem non-debug static version. I was surprised to find that the above command installs shared libraries for some of the libraries
<runtime-link> is the feature that describes whether you will link to the static or shared *C++ runtime* library. It doesn't affect whether you will build static or shared boost libraries. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com
participants (2)
-
Daniel Huber
-
David Abrahams