link c code with c++ code using g++

J

J.Artieda

I compile one object using gcc and another using g++ then i use g++ to link
the to objects and i get that the fuctions of the c object are unknown
references for the c++ object.
can any body explain me how can i link c code with c++ code ?
i tried extern "C" but seems that that doesn't compile with g++
thanks jorge
 
R

Ravi

Compile all your source code (both C and C++) using g++ and use the
extern C feature to turn off name mangling for the C functions.
HTH,
Ravi.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,141
Messages
2,570,817
Members
47,362
Latest member
ChandaWagn

Latest Threads

Top