Home > OS >  What does compile with -DPSAPI_VERSION=1 mean?
What does compile with -DPSAPI_VERSION=1 mean?

Time:01-27

In the link below the C code's comments it says;

// and compile with -DPSAPI_VERSION=1

https://docs.microsoft.com/en-us/windows/win32/api/psapi/nf-psapi-enumprocessmodules

How do we compile with -DPSAPI_VERSION=1 ?

CodePudding user response:

Two possibilities

just before the include of windows.h add

#define PSAPI_VERSION=1

or in the project properties there is a place to define macros, add PSAPI_VERSION=1 there

CodePudding user response:

Macros are defined in the program. I usually define a macro in the cmake file as a switch. Then in the program, if the macro is found to be defined, the algorithm library call is executed, because my algorithm library is sometimes not configured properly.

CMakeLists.txt

add_definitions(-DRecognitionLIB")

in cpp file
#ifdef RecognitionLib
#include <GBProcess.h>
#include <AIScrapperVision.h>
#endif

function aaa()
{
#ifdef RecognitionLib
  some code
#endif
}
  •  Tags:  
  • Related