Friday, April 20, 2012

MSVC environment variables not showing up in different terminals

I'm using HaXe's HXCPP to generate C++ code and compile it with Microsoft Visual Studio 2010 Express Edition. I'm following this guide and it asks you to run "c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\vsvars32.bat" so that cl.exe (the compiler) is in your build path.



This does allow me to run cl.exe, but only in that terminal. It fails if I attempt to run it from another terminal or within my IDE (Sublime Text 2).



I figured out a workaround: manually copy+paste variable values from the terminal to the GUI enviorment variable editor.



There's gotta be a better way. What am I missing?



build.hxml



-main Test
-cpp bin


Test.hx



class Test {
static function main() {
trace("Hello World!");
}
}


Error message when building



link.exe -out:Test.exe -nologo -machine:x86 -libpath:lib user32.lib -libpath:e:/VS8/PlatformSDK/Lib @all_objs
LINK : fatal error LNK1181: cannot open input file 'user32.lib'
Called from ? line 1
Called from BuildTool.hx line 1246
Called from BuildTool.hx line 554
Called from BuildTool.hx line 591
Called from BuildTool.hx line 710
Called from BuildTool.hx line 796
Called from BuildTool.hx line 285




No comments:

Post a Comment