How can I handle DLL_EXPORT when compiling dll to a static library?
问题 I have a project in visual c++ 2010, which contains preprocessor directives in a key header file. Actually, it is the ZMQ source code. The project is normally configured to be a dll, so the header uses DLL_EXPORT's status (defined/not defined). If the project is used to compile a dll, the header can be used by both the dll project or the client code, thanks to the following setup taken from zmq.h: #if defined _WIN32 # if defined DLL_EXPORT # define ZMQ_EXPORT __declspec(dllexport) # else #