friendlyanon / cmake-init

The missing CMake project initializer
GNU General Public License v3.0
1.98k stars 75 forks source link

How to deal with C4251 warning #2

Open friendlyanon opened 3 years ago

friendlyanon commented 3 years ago

https://stackoverflow.com/a/22054743 gives a good summary for possible remedies.

PIMPL seems to be the best option, but is that really a good concept to have in an init script targeting mainly beginners?
Need to think about this.

friendlyanon commented 3 years ago

Another option that I came across is wrapping the library exports in a C API with a header-only library component on top to provide a usable C++ API. Consequently, this is also a method to mix binaries created with different compilers, compile flags and ABI.

friendlyanon commented 3 years ago

I have pushed 7bca880a8cc3bdb0e23d74c532e805e955a860a8 disabling this warning and with an explanation in the header file template of the shared library.

friendlyanon commented 3 years ago

@satya-das has a WIP solution called cib, which generates an hourglass interface similar to what was described by @sdutoit