View Single Post
Join Date: Dec 2005
Posts: 5,851
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 749
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: Calling C++ function from C code

 
0
  #2
Jan 5th, 2009
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.
Reply With Quote