Thread
:
Calling C++ function from C code
View Single Post
•
•
Join Date: Dec 2005
Posts: 5,851
Reputation:
Solved Threads: 749
Salem
Offline
Void main'ers are DOOMed
Re: Calling C++ function from C code
0
#
2
Jan 5th, 2009
Help with Code Tags
(
Toggle Plain Text
)
g++ -c cppcode.cpp gcc -c main.c g++ -o test main.o cppcode.o
g++ -c cppcode.cpp gcc -c main.c g++ -o test main.o cppcode.o
Oh, and that might not work either.
This is how to mix C and C++
http://www.parashift.com/c++-faq-lit...c-and-cpp.html
In particular, the main() needs to be C++ so that global ctors/dtors get called.
Salem
View Public Profile
Find all posts by Salem