2 ms·
C++ linking would be very convenient for library users - when it works. Correct me if I'm wrong, but you are only guaranteed to be able to link to a C++ library
by Zondartul 4y ago
C++ linking would be very convenient for library users - when it works. Correct me if I'm wrong, but you are only guaranteed to be able to link to a C++ library if you are compiling with the exact same compiler (brand and version). In other cases it's hit and miss if the ABI would match, as everyone seems to have a slightly different version of C++ ABI.
It's a shame really, because my OOP brain doesn't much like making a C interface to what is essentially a bunch of C++ objects.
- garaetjjte 4y agoCompilers generally try to preserve ABI between versions, or include compatibility options (like -fabi-version in g++)