Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-10-12 13:48:20

Matthias Troyer <troyer_at_[hidden]> writes:

> Hi,
> When trying to build the boost libraries under the current MacOS X
> version I run into error messages of the type:
> template with C linkage
> I could pin this down to the use of the -isystem option used when
> compiling the files, and found a small test file which shows this
> error:
> The following preprocessed source file shows the same error:
> # 1 "/Users/troyer/src/boost/boost/config.hpp" 1 3 4
> extern "C" {
> }
> template <class _Tp> class X;
> The error message is
> /Users/troyer/src/boost/boost/config.hpp:3: template with C linkage
> and vanishes if the first line (the directive # 1 "/ ....) is removed.
> Did anybody else have similar problems? Changing the -isystem option
> to -I in the build file solved the problem for me, but I want to know
> what the reason is, and if this is a bug that should be reported to
> Apple or to the FSF.

Absolutely it should be reported to FSF. It shows up on Sun as well,
and we implemented a workaround in tools/build/gcc-tools.jam as you
can see. I think (though I don't have a perfect memory of this) that
the person who asked us to implement the workaround for Sun submitted
a bug report, but with only a very large test case. I'm not sure how
soon it will be addressed on that basis.

Ah, no, it appears to be in a form of developer-disbelief-limbo see
report #7327 at

The docs for -isystem say:

-isystem dir
   Search dir for header files, after all directories specified by -I
   but before the standard system directories. Mark it as a system
   directory, so that it gets the same special treatment as is applied
   to the standard system directories.

Someone seems to think that files with -isystem can be wrapped in
extern "C", but then how do the standard C++ library headers get

           David Abrahams * Boost Consulting
dave_at_[hidden] *

Boost list run by bdawes at, gregod at, cpdaniel at, john at