views:

62

answers:

4

I'm trying to build a package on a RedHat system. First, I ran ./configure CXX=cpp, because /usr/bin/cpp is the C++ compiler on that system. But when I run make, it dumps:

cpp: "-c" is not a valid option to the preprocessor

When I do a Google search, I found a number of complaints, but no solutions. Anyone else encounter this?

+9  A: 

cpp is the C preprocessor; perhaps you mean cc (the C compiler) or gcc (for GNU C compiler) or g++ (for the GNU C++ compiler)?

James McNellis
+5  A: 

cpp is the preprocessor, try c++ instead.

Georg Fritzsche
A: 

you probably are looking for g++ (GNU C++ Compiler) as cpp is the C preprocessor.

g++ is a special invocation of gcc in that it automatically includes a couple of directories needed for gcc's c++ runtime into the library search path.

diverscuba23
A: 

I had to install the cpp-g++ package. I'm not used to Redhat systems, and hadn't built a C++ program in quite a while, hence my confusion.

Thanks to all for your generous responses.

lsiden