Cleaner code, faster compilation times, and future-proofed projects. 2. Improved Marshalling Efficiency
// platform_api.h #ifdef _WIN32 #ifdef XPLATCPP_EXPORTS #define PLATFORM_API __declspec(dllexport) #else #define PLATFORM_API __declspec(dllimport) #endif #else #define PLATFORM_API __attribute__((visibility("default"))) #endif
Right-click the Windows Start menu and open or PowerShell (Admin) .
Cross-platform projects rely heavily on CMake. Regenerate your Visual Studio build files ensuring target architectures (x86, x64, ARM64) are explicitly defined. xplatcppwindowsdll updated
#ifdef _WIN32 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) if (fdwReason == DLL_PROCESS_DETACH && !Engine::instance().isShutdown()) OutputDebugString(L"Warning: xplatcpp DLL unloaded without calling shutdown()");
To ensure your DLL compiles and updates cleanly without breaking downstream applications, define a highly compatible macro system for symbol exporting. The Header ( include/xplat_core.h )
The project has been in stable use for two years, but the latest update introduces several pivotal improvements. Cross-platform projects rely heavily on CMake
To generate your Windows DLL, use a standard developer command prompt or terminal runner to fire the following CMake commands:
The previous static initialisation could cause crashes on DLL load/unload. Updated to use std::call_once and a controlled shutdown:
Allows shared C++ logic to run on Linux, macOS, and Windows. The Header ( include/xplat_core
This means you can compile the same source code to a Windows DLL using g++ on MSYS2 or clang on Cygwin without modifying a single #ifdef .
This public link is valid for 7 days and shares a thread, including any personal information you added. This link or copies made by others cannot be deleted. If you share with third parties, their policies apply. Can’t copy the link right now. Try again later.
The new load-time profiler will flag any non-trivial static objects. The recommended pattern is now: