Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: C++
Expertise: Beginner
Oct 29, 1998



Building the Right Environment to Support AI, Machine Learning and Deep Learning

C/C++ Linking

If I make a C++ library and supply it to a client who does not have a C++ compiler, can they call my C++ functions from their C routines? That is, is it possible to use the C++ library without having a C++ compiler installed (on UNIIX).

It is possible to use your library as long as your client uses a language that allows them to call the library. For example, this is possible from C but they will need at least a C compiler.

There are some more complicated issues, however. Because C++ allows you to create functions with the same name as long as the arguments are different (function overloading), C++ "mangles" the function name based on the arguments so the linker can tell the difference. Therefore, in order to call C++ routines from C, you must either know the mangled names and call them, or you must export your C++ functions as C functions.

DevX Pro
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date