1751695 Members
5125 Online
108781 Solutions
New Discussion юеВ

Re: link for C++ and C

 

link for C++ and C

we could link the c++ archive with c files.is it possible?

Thanks in Advance!
4 REPLIES 4
Dennis Handly
Acclaimed Contributor

Re: link for C++ and C

I'm not sure what you are asking. You can add object compiled by C or C++ into the same archive lib.

You can link C sources with aC++ objects, archives or shared libs, provided you use aCC to link.

http://www.docs.hp.com/en/7762/5991-4874/distributing.htm#linking
http://www.docs.hp.com/en/7762/5991-4874/otherlangs.htm

Re: link for C++ and C

I mean to say.

i have API which is compile with c++.
and client is compile with c.
is it possible to link client to api archive.
Dennis Handly
Acclaimed Contributor

Re: link for C++ and C

>I have API which is compile with C++ and client is compile with C. Is it possible to link client to API archive?

See the above links.
Yes. If you want to call C++ functions in C, you need to declare them as extern "C" so they aren't mangled.

Dennis Handly
Acclaimed Contributor

Re: link for C++ and C

If you have gotten the answers to your questions you should assign points based on:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33