Unix Programming - make: c++: "-c" is not a valid option to the preprocessor

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > January 2004 > make: c++: "-c" is not a valid option to the preprocessor





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author make: c++: "-c" is not a valid option to the preprocessor
nick

2004-01-23, 5:12 pm

Hi,

I'm trying to learn the 'GNU Autotools' basics so I started with a simple
C++ 'Hello World' program and wrote a 'Makefile.am' and a 'configure.in'.
I'm following the 'GNU Autotools' book.

Makefile.am:
bin_PROGRAMS = hello
hello_SOURCES = hello.cpp

configure.in:
AC_INIT(hello.cpp)
AM_INIT_AUTOMAKE(hello, 0.1)
AC_PROG_CXX
AC_OUTPUT(Makefile)

Then, I run 'aclocal', 'autoconf', 'touch NEWS README AUTHORS ChangeLog',
and 'automake --add-missing'. Afterwards I try to test it so I run
'./configure' and make. When I do make I get:
c++ -DPACKAGE=\"hello\" -DVERSION=\"0.1\" -I. -I. -c hello.cpp
c++: "-c" is not a valid option to the preprocessor

I think the problem would be solved if I could tell make to use g++ and not
c++ as the compiler. Any idea what autoconf macro can do that? Or I'm
looking on the wrong place? I'm reading the autoconf manual but can't find
it.

Any ideas?

I'm running Mandrake Linux 9.0, aclocal 1.4-p6, autoconf 2.13, and automake
1.4-p6 (libtool is version 1.4.2 but that doesn't seem to matter here)

Thanks,

Nick
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com