在Windows中实际导出全局变量,您必须使用类似于export / import语法的语法,例如:

1 #ifdef COMPILING_THE_DLL
2 #define MY_DLL_EXPORT extern "C" __declspec(dllexport)
3 #else
4 #define MY_DLL_EXPORT extern "C" __declspec(dllimport)
5 #endif
6 
7 MY_DLL_EXPORT int my_global;

 

参考网址:

https://codeday.me/bug/20170811/55724.html

https://blog.csdn.net/mangobar/article/details/53390552

https://blog.csdn.net/silvervi/article/details/5055707

相关文章:

  • 2021-12-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-08
  • 2021-05-18
  • 2022-12-23
  • 2021-07-30
猜你喜欢
  • 2021-08-08
  • 2022-12-23
  • 2021-10-31
  • 2022-02-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案