This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC 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: mixing C and C++


This may have no bearing on your problem (which sounds probably like a coding issue to me), but I would think that if you're calling a C++ function from your file containing main, then you're really compiling C++ code in your "main" file rather than C code - even if everything else is C code.  I would compile any file using or calling C++ code with g++ instead of gcc.

Cheers,
Lyle

-----Original Message-----
From: Frank Signorelli [mailto:telfsig@yahoo.com] 
 
Compile a main function in a *.c file using gcc.
?
compile function "foo" in a *.cpp file using g++.
?
compile function "bar" in a *.c file using gcc.
?
main invokes foo which invokes bar.


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