简体   繁体   中英

Running scons from windows cmd mismatch path env variable

I'm trying to compile using scons 2.0.1 my project. I set scons to use gcc for this issue. I have cygwin installed in my pm and when I'm running the command "gcc" straight from my cmd, it is recognized as a command because c:/cygwin/bin exists in the path env variable. But when I'm running scons from the same cmd. gcc is not recognized well, so I tried to see the path env variable that scons uses(I assumed that supposed to be the same as the system path), but when I put in the sconstruct the command os.system("path") or os.environ["PATH"] I get a different path variable that cygwin does not exists there.

Please if someone know what should I do to fix that?

Thanks allot, asaf

env = Environment(ENV = {'PATH' : os.environ['PATH']})

Above is the usual fix for what you describe. If you want your build script to work for everyone, regardless of their personal environment, then use the following.

env = Environment(ENV = {'PATH' : r'C:\cygwin\bin'})

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