#if defined(_MSC_VER) // Microsoft #ifdef EXPORTING_DLL #define EXPORT_DLL __declspec(dllexport) #else #define EXPORT_DLL __declspec(dllimport) #endif #elif defined(__GNUC__) // GCC #ifdef EXPORTING_DLL #define EXPORT_DLL __attribute__((visibility("default"))) #else #define EXPORT_DLL #endif #else // do nothing and hope for the best? #ifdef EXPORTING_DLL #define EXPORT_DLL #else #define EXPORT_DLL #endif #pragma warning Unknown dynamic link import/export semantics. #endif
跨平台编译时控制dll导出的方式的写法
最新推荐文章于 2025-04-10 10:40:47 发布