Boost logo

Boost-Build :

From: Anthony Novatsis (anthonynovatsis_at_[hidden])
Date: 2007-12-19 05:02:11

Hello All,

I have an application written in C compiled with Boost.Build and the
output executable has a runtime dependency on libstdc++. See the
simple example below.


int main(int argc, char* argv[])
    return 0;


exe test : main.c : : ;

Executing bjam (linker command line: "g++-4.1" -o
"bin/gcc-4.1/debug/test" -Wl,--start-group "bin/gcc-4.1/debug/main.o"
  -Wl,--end-group -g) produces an executable with the following

ldd ./bin/gcc-4.1/debug/test => (0xffffe000) => /usr/lib/ (0xb7e92000) => /lib/tls/i686/cmov/ (0xb7e6d000) => /lib/ (0xb7e61000) => /lib/tls/i686/cmov/ (0xb7d17000)
        /lib/ (0xb7f94000)

After re-running the link step manually and replacing g++-4.1 with
gcc-4.1, the output executable has the following dependencies:

ldd ./bin/gcc-4.1/debug/test => (0xffffe000) => /lib/tls/i686/cmov/ (0xb7e54000)
        /lib/ (0xb7fad000)

I need to eliminate the dependency on libstdc++ as the application
will eventually run on a target where there is no C++ runtime. Is
there any way to configure Boost Build to use gcc instead of g++.
Perhaps by configuring the C and C++ compiler separately or some other
work around ? Or am I doing something else wrong ?

Thanks in advance.


Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at