In the Visual studio configuration type is how to determine the current engineering. Lib?
As shown in figure but _AFXDLL this macro is not
Excuse me which macros can judge whether the current engineering generated. Lib file?
CodePudding user response:
In the engineering to distinguish don't come outAfter the compilation is not link to generate an executable file, use lib. Exe. O file package generated. Lib can
Specific you can Google baidu static library development, many tutorial will teach you how to compile the package,
CodePudding user response:
The macro is to a certain extent, you can also judge that, because is not a static library and dynamic library, there is no main method cannot link into an executable fileCodePudding user response:
# ifdef _LIBDo something
# endif//_LIB
CodePudding user response:
Can after the project is set to the Lib, in C/C + + preprocessor option to add a definition such as _LIB, then# ifdef _LIB
# pragma message (" This is a static library ")
# endif//_LIB