Search code examples
preprocessordevenv

how do I add preprocessor #define in devenv command line?


Is there a way to add extra preprocessor #define in devenv command line?


Solution

  • I am not entirely sure what you mean by vcbuild command line but if you mean the Visual C++ command line compiler then you can add defines by add /Dxxxx, e.g.

    cl.exe /DSHAREWARE ....
    

    Additional answer based on comments:

    You should be able to set the CL environment variable with the extra preprocessor define:

    SET CL=/DSHAREWARE
    devenv ....
    

    Mere information can be found at MSDN