Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2008-02-16 13:48:54

Anthony Novatsis wrote:

>> You can use 'gcc' as compiler command, in user-config.jam.
>> This is generally not recommended exactly because it won't link to
>> libstdc++, but you seem to want not to link to it.
>> - Volodya
> Actually this is not what I want since I would like to use the same
> configuration to build C and C++ code. I'd like to be able to
> configure Boost.Build as such so that when I compile C++ files g++ is
> used and when I compile C files gcc is used.
> Is this possible ?

That's precisely what is done, for *compilation*. However, when linking,
we always use "g++", since we don't know if C++ is used or not, in general.

As a workaround, you can pass the


option to linker for the targets that you know don't use C++,

        exe a : a.cpp : <linkflags>"-nostdlib -lc"

(You might add something to -lc, I did not tested this)

- Volodya

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