This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
mixing C and C++
- From: Frank Signorelli <telfsig at yahoo dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 2 Oct 2003 08:14:43 -0700 (PDT)
- Subject: mixing C and C++
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