简体   繁体   中英

How do I define an environment variable/macro in a VC++ project?

I'm trying to build FTGL in Visual C++ 2008. According to the documentation, I need to define a macro called $(FREETYPE) containing the path to the FreeType library code, but I'm having a heck of a time figuring out how that's done.

I've been all over the project options and the Visual C++ options, and I can't find the place to define this macro anywhere. When I look for help online, all I find is stuff talking about how to define an environment variable in the debugger (not helpful when I'm trying to compile) or other pages saying to define it as a literal environment variable in the Control Panel, which is kind of ridiculous. It smacks of using global state to manage a local problem .

I'm completely lost here. I'm used to using Delphi, where doing this is trivial, and I can't believe that no mechanism for setting this macro exists anywhere in the Visual Studio IDE, so I figure I must be overlooking something. Does anyone know the right place to define it so things will compile right?

Well if nothing else works just define it in windows

Computer / Properties / Advanced System settings / Environment Variables

define FREETYPE= to whatever you want to set it then restart visual studio for it to take effect.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM