For this reason, the global symbols need to be explicitly exported via __declspec(dllexport) and __declspec(dllimport), that are added via a XLinkExport.h header generated by the generate_export_header CMake function.
Without this fix, linking an executable against the XLink shared library on Windows fails with error:
The variable
CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS
used to supportBUILD_SHARED_LIBS
works fine for all symbols, except static/global variable (see https://cmake.org/cmake/help/latest/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS.html and https://www.kitware.com/create-dlls-on-windows-without-declspec-using-new-cmake-export-all-feature/).For this reason, the global symbols need to be explicitly exported via
__declspec(dllexport)
and__declspec(dllimport)
, that are added via aXLinkExport.h
header generated by thegenerate_export_header
CMake function.Without this fix, linking an executable against the
XLink
shared library on Windows fails with error: