c++ - How to tell if current project is dll or static lib? -
in header i'd #pragma comment lib
correct lib file depending upon whether project including header , being built dll or staticlib project.
are there predefined preprocessor variables can #if on work out?
i've seen _dll
can used see if static or dynamic crt being used here: https://msdn.microsoft.com/en-us/library/b0084kay.aspx?f=255&mspperror=-2147217396
there no pre-defined macro functionality. the msdn covers these
however, when creating new project of these types, visual-studio appends _lib (static library) or _usrdll (dynamic library) macro build-settings of project.
you can reasonably assume that, given project created using current visual-studio workflow, these defined - however, aware may subject change in future, , may not present if user has used non-standard method create project.
Comments
Post a Comment