mixing C and C++

Frank Signorelli telfsig@yahoo.com
Thu Oct 2 15:14:00 GMT 2003


I wish to know if the following scenario is supported
with gcc:
 
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.
 
I have used extern "C" where appropriate.
 
Everything compiles and links ok but I get strange
behavior at run time.
Some programs just dump core, others just do not work
right (e.g., copied
strings are not the same as the original).
 
I sure would appreciate an answer if anyone knows it.
I have been looking at this
scenario for a long time. Simple programs work ok - it
is the complicated ones
that are giving me trouble.
 
Thanks in advance,
 
Franc



__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com



More information about the Gcc-help mailing list