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