I have a C library in an archive file, clib.a
. I've written a C++ wrapper for it, cpp.o
, and would like to use this as a static library:
ar cTrvs cppwrap.a clib.a cpp.o
Code which links to this won't be able to use the stuff from clib.a
directly unless the correct header is included. However, if someone coincidentally creates an appropriate prototype -- e.g. void myCoincidentallyNamedGlobalFunction()
-- I'm concerned which definition of myCoincidentallyNamedGlobalFunction
will apply.
Since the symbols from clib.a
only need to be accessed in cpp.o
, and not anything linked to cppwrap.a
, is there a way to completely hide them so that there is no possible collision (so even including the clib header would fail)?