wxWidgets in c++ on windows
wxWidgets in c++ on windows
>我正在阅读这个特定的代码片段:-
class WXDLLIMPEXP_CORE wxCommandEvent : public wxEvent, public wxEventBasicPayloadMixin
这是在event.h头文件中定义的,我不明白"WXDLLIMPEXP_CORE"。
谢谢
如果我们看一下它的定义,我们会看到
#ifdef WXMAKINGDLL_CORE
# define WXDLLIMPEXP_CORE WXEXPORT
# define WXDLLIMPEXP_DATA_CORE(type) WXEXPORT type
# if defined(HAVE_VISIBILITY)
# define WXDLLIMPEXP_INLINE_CORE WXEXPORT
# else
# define WXDLLIMPEXP_INLINE_CORE
# endif
#elif defined(WXUSINGDLL)
# define WXDLLIMPEXP_CORE WXIMPORT
# define WXDLLIMPEXP_DATA_CORE(type) WXIMPORT type
# if defined(HAVE_VISIBILITY)
# define WXDLLIMPEXP_INLINE_CORE WXIMPORT
# else
# define WXDLLIMPEXP_INLINE_CORE
# endif
#else /* not making nor using DLL */
# define WXDLLIMPEXP_CORE
# define WXDLLIMPEXP_DATA_CORE(type) type
# define WXDLLIMPEXP_INLINE_CORE
#endif
文件中其他地方的注释对正在发生的事情进行了很好的解释,但简要总结一下,有三种情况,我们正在制作 DLL,使用 DLL 或根本不使用。最后一种情况是最简单的,如果我们根本不使用 DLL,那么它们就会被定义为零。如果我们正在制作一个 DLL,那么它将类标记为导出,如果我们使用 DLL,那么它将类标记为已导入。
相关文章:
- SFML 交叉编译 for Windows on Linux.
- Cmake with Flex/Bison on windows
- Boost::process on Windows - with MinGW?
- anaconda cythonize C++ on windows 10
- CMake & MinGW Compileilation on Windows,无需 -G "MinGW Makefiles"标志
- Windows Machine Learning (winML) on ARM
- 用于Clang on Windows的CMake生成器
- boost::stacktrace on Windows MSVS 2017
- TLS with http_listener in Microsoft cpprestsdk on Windows
- DirectX 11 on Windows 10
- CppFlow on windows 10
- OpenMP 4.5 on Windows with Clang, CMake & Ninja
- SDL 2.0.7 touch on Windows
- C++ on Jupyter Notebook for Windows
- WinHttpSendRequest and HTTPS on Windows XP
- OpenSSL on Windows and Visual Studio 2010
- 在 Windows for Linux on Intel 上编译C++库
- OpenCV on eclipse on windows
- C++ [[gnu::visibility( "default" )]] vs __declspec(dllexport) on Windows 和 Linux
- endian.h on Windows