HaxeFoundation / hxcpp

Runtime files for c++ backend for haxe
Other
294 stars 184 forks source link

Visual Studio 2017 'cl.exe' is not recognized #590

Open JeriXNet opened 7 years ago

JeriXNet commented 7 years ago

I've reinstalled my windows 10 Then installed Visual Studio 2017 Community with all C++ related options enabled And tried to build very simple haxe project with hxcpp:

'cl.exe' is not recognized as an internal or external command

And when I tried to run "%VS140COMNTOOLS%\vsvars32.bat" I got this:

ERROR: Cannot determine the location of the VS Common Tools folder

Am I the only one having these issues? Or maybe MS broke things again?

ghost commented 7 years ago

Experiencing the same issue. Tried both vs2015 (all cpp externals installed) as well as 2017.

hughsando commented 7 years ago

I have not tried 2017 yet. Maybe microsoft did move some stuff. You can compile with -D HXCPP_VERBOSE=1 to get some debug. Do you have the VS140COMNTOOLS variable and the vsvars32.bat file ? I guess if this is not here, then there will be problems. You can try setting the HXCPP_MSVC variable to the location of the vsvars32.bat file if it has moved. This is best done in the ~/hxcpp_config.xml file.

JeriXNet commented 7 years ago

Yep, I do have VS140COMNTOOLS variable defined, and it contains path to vsvars32.bat file, but I think Microsoft actually broke things because I got this when tried to run "%VS140COMNTOOLS%\vsvars32.bat" manually:

ERROR: Cannot determine the location of the VS Common Tools folder

and this bat sets VS140COMNTOOLS to empty

I guess I should switch to mingw for now...

hughsando commented 7 years ago

You can run msvc without the setup - but it requires that your system is set up globally, ie cl.exe is in your path and INCLUDE and LIBRARY is set. This is done via the NO_AUTO_MSVC define. You could also try the 64 bit version with -D HXCPP_M64=1

iamfraggle commented 7 years ago

Isn't VS140COMNTOOLS for VS2015? I just installed VS2017 and don't have a VS150COMNTOOLS variable. Googling 'VS150COMNTOOLS' took me to this https://developercommunity.visualstudio.com/content/problem/25776/vs150comntools-does-not-exists.html

"In order to reduce the impact of Visual Studio on the system, and also support Side-by-Side for Visual Studio Preview with the same major release (https://www.visualstudio.com/vs/preview), some global environment variables or registry will not be registered with Visual Studio 2017.

Please check out vswhere project - https://github.com/Microsoft/vswhere, which provides the new way to locate Visual Studio 2017 and later in scripting environment."

Looks like they've completely changed things.

kensolano commented 6 years ago

Just search windows (the magnifier glass icon next to the start menu's icon). Then write "Developer Command Prompt" so you'll get the Developer Commando Prompt for VS your VS version. and that's all, cl will only work into a Developer Command Prompt