This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Wrong configure test for PCH ?


On Tue, Sep 30, 2003 at 08:50:37AM -0500, Benjamin Kosnik wrote:
> 
> >AC_DEFUN(GLIBCXX_ENABLE_PCH, [
> >...
> >
> >      echo '#include <math.h>' > conftest.h
> >      if $CXX $CXXFLAGS $CPPFLAGS -x c++-header conftest.h \
> >             -o conftest.h.gch 1>&5 2>&1 &&
> >...
> >
> >I think there is a '-c' missing there.
> 
> No, not with  -x c++-header.
> 
> %/mnt/hd/bld/gcc/gcc/xgcc -B/mnt/hd/bld/gcc/gcc/ -B/mnt/hd/bld/H-x86-gcc/i686-pc-linux-gnu/bin/ -B/mnt/hd/bld/H-x86-gcc/i686-pc-linux-gnu/lib/ -x c++ config.h -o config.h.gch
> /usr/lib/crt1.o(.text+0x18): In function `_start':
> : undefined reference to `main'
> collect2: ld returned 1 exit status
> 
> 
>  %/mnt/hd/bld/gcc/gcc/xgcc -B/mnt/hd/bld/gcc/gcc/ -B/mnt/hd/bld/H-x86-gcc/i686-pc-linux-gnu/bin/ -B/mnt/hd/bld/H-x86-gcc/i686-pc-linux-gnu/lib/ -x c++-header config.h -o config.h.gch
> 
> 
> This configure test is correct.

Then why do I get:

$ cat conftest.h
#include <math.h>
$ g++-cvs-3.4 -g -fno-exceptions -pipe -x c++-header conftest.h -o conftest.h.gch
/usr/lib/crt1.o(.text+0x18): In function `_start':
../sysdeps/i386/elf/start.S:77: undefined reference to `main'
collect2: ld returned 1 exit status

Adding a '-c' makes it work.

-- 
Carlo Wood <carlo@alinoe.com>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]