cd third_party/xplatcppwindowsdll git checkout v3.0.0 cd ../.. git add third_party/xplatcppwindowsdll If you use vcpkg or Conan, update your manifest:
extern "C" XPLATCPP_PUBLIC int add(int a, int b) return a + b;
Set CMAKE_MSVC_RUNTIME_LIBRARY consistently across all projects. 🔴 Pitfall 2: C++ Exceptions Crossing DLL Boundaries Throwing an exception from a DLL and catching it in the main executable is unsafe if they aren’t compiled with the same compiler and EH flags. The updated toolchain optionally wraps all public functions with a std::error_code facade. xplatcppwindowsdll updated
// vcpkg.json "dependencies": [ "xplatcppwindowsdll", // version >=3.0.0 ] The function signature for add_xplatcpp_dll has changed to xplatcpp_windows_dll . Here’s a migration diff:
XPLATCPP_PUBLIC MyClass& getInstance() static MyClass instance; // thread-safe in C++11 and later return instance; cd third_party/xplatcppwindowsdll git checkout v3
This article was last updated in April 2026, based on xplatcppwindowsdll version 3.0.0.
rm -rf build/ cmake -B build -G "Visual Studio 17 2022" -A x64 cmake --build build --config Release Run the new validation tool that ships with the update: The updated toolchain optionally wraps all public functions
Clean your build directory and re-configure: