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]

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


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