How to build a compiler-independent C++ library (for Solaris Studio and gcc)?
问题 I would like to extend my library, which currently compiles only using gcc, to be used by Solaris Studio as well. My idea is to do the following: Write wrapper functions in C, which expose the relevant parts of the interface with extern C linkage. Then build this library using gcc. The resulting c-header and binary are compiler independent as there is no name mangling anymore. Include the c-header and link into the project compiled with Solaris Studio. Question: Is this a feasible approach or