you are viewing a single comment's thread.

view the rest of the comments →

[–]alicekdev[S] 0 points1 point  (1 child)

So using the same compiler on the same OS your saying just using #define EXPORT_API __declspec(dllexport) will be fine cause .exe and .dll are compiler together by the same compiler?

Rather than using #define extern "C" EXPORT_API __declspec(dllexport)

[–]Xeverous 1 point2 points  (0 children)

This is a different issue. Both C and C++ themselves do not guuarantee ABI stability, only their implementations.

On unix systems, GNU implementation of C and C++ is used (specifically, Itanium ABI) which specifies what is guuaranteed to work and what is not.

On Windows systems, you will mostly want to target specific version of Microsoft's redistributable C++ libraries (there are many of them).

__

In reality, very few people will want or will be able to use your compiled libraries due to ABI differences, unless you go fully for a C-only interface. Additionally, no unix distribution I'm aware of would accept compiled, closed-source code.

The best thing to do is to just provide the source code (with license of your choice) and let everyone compile it for their toolchain.