Windows export: 'cl.exe' is not recognized as an internal or external command,

This is correct. Since this folder is in your path, hxcpp will look there for cl.exe. Have you tried compiling?

Sorry, I guess I misspoke when I said it had to match exactly. (And even emphasized the word “exactly” for effect.) The path, minus “\cl.exe,” is what has to match.

Also, good to know that you have to set it for all users. I’ll update my previous post in case anyone visits this thread later.

So erm, the paths seem to be updated correctly… what else could be causing this? I’ll re-post my full error message in case something changed that I didn’t realize:

'cl.exe' is not recognized as an internal or external command,
operable program or batch file.
Error: error running cl.exe -Iinclude -nologo -DHX_WINDOWS -D_USING_V140_SDK71_ -GR -O2 -Oy- -c -EHs -GS- -arch:SSE -IC:/HaxeToolkit/haxe/lib/hxcpp/3,3,49/include -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=330 -D_CRT_SECURE_NO_DEPRECATE -D_ALLOW_MSC_VER_MISMATCH -D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH -wd4996 -Ie:/VS8//PlatformSDK/Include -MT -Ychxcpp.h -Yllink274eaa16c89e1335185d5725af799279 J:/HAXE/SodaDungeon/bin/windows/cpp/release/obj/obj/msvc-ncxp/__pch/haxe/hxcpp.cpp /FpJ:/HAXE/SodaDungeon/bin/windows/cpp/release/obj/obj/msvc-ncxp/__pch/haxe/hxcpp.pch -FoJ:/HAXE/SodaDungeon/bin/windows/cpp/release/obj/obj/msvc-ncxp/__pch/haxe/hxcpp.obj
Build halted with errors.

Wait a minute…

HXCPP only sets this if you have Visual Studio 14. Or at least, if VS140COMNTOOLS is defined.

What happens when you run this?

> "%VS140COMNTOOLS%\vsvars32.bat"
> where cl.exe

What happens when you run this?

After the first command, nothing. After the second:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cl.exe

I do have VS 2014 installed, as I see similar output in my mvsc-setup path:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\;
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN;
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools;

But I’ve been assuming that VS 10/14 stay isolated from each other, and that hxcpp requires VS 2010 since it tries to install that after running openfl setup windows

Well, that’s unexpected. Shouldn’t it have added its own path? (I don’t actually know how vsvars32.bat works, and I don’t have time to dig into it.)

That’s closer to what I was expecting. Did you check in Microsoft Visual Studio 14.0\vc\bin for cl.exe?

No, that’s just what OpenFL suggests. hxcpp seems to support everything up to 14; otherwise msvc-setup.bat wouldn’t check for 14.

That said, the solution might be to go with 10, if 14 is missing cl.exe. Do this by deleting VS140COMNTOOLS from your environment variables, or by setting HXCPP_MSVC to the value of VS100COMNTOOLS.

Welp, there we go. VS 2014 does not come with cl.exe by default. It appears it can be manually installed, but I only see official downloads for VS 2015. So like you suggested I just created a new system environment variable called ‘HXCP_MSVC’ and set it equal to

C:\Program Files (x86)\Visual Studio 10.0\Common7\Tools

game seems to run and export just fine now, though I’ve noticed that the glow filters I use on text aren’t rendering like they should be. will do some testing tomorrow and see if I can figure that out.

In the meantime, thank you!

You’re welcome!

By the way, I suggest clicking the checkbox on your post so that future readers can easily find the solution.

ah, nice feature.

so how to prevent an issue like this in the future? is anyone with VS 2014+ going to encounter this since cl.exe might be missing?

I think anyone who installed VS 2014 without checking the correct checkbox will encounter this. There isn’t much we can do about that except let people know.

1 Like

is now changed to

HXCPP_MSVC

1 Like

i just update to
openfl 8.1.1
lime 6.3.1
hxcpp 3.4.188

and this problem still persist today:
‘cl.exe’ is not recognized as an internal or external command,
operable program or batch file.
Error: Could not create PCH

can we have a document to solve this ?

i look for the Win32 C++ support but cant find it

is this what we have to look at? VC++ 2017 version 15.7 v14.14 Libs for Spectre (x86 and x64)

where can we found visual studio 10 these day?

Hi,

AFAIK, VSC 10 has issues and compiles very slow, if at all. VSC 17 has other issues, too. I installed VSC 15. You need to make a free account here, https://www.visualstudio.com/, and when you log in you can download older versions.

This link is after you have an account and are logged in. It might not work. If not go to downloads after you log in.

https://my.visualstudio.com/Downloads?q=Visual%20Studio%202015%20with%20Update%203

If I remember, it didn’t install VC++ by default and I got the same cl.exe not found error. I went to control panel and changed the install from there, without reinstalling.

Hope it helps!

1 Like

i install visual estudio 2013, but whem i compile with openfl 4.2.0 and lime 3.2.1 hxcpp 3.2.102

i got this error
Error: Could not find include file “C:/HaxeToolkit/haxe/lib/hxcpp/3,2,102/src/hx/libs/regexp/Build.xml”

why im using this older settings? because i just came from openfl 8 etc and it is real slow, like 10 fps now, really dont know what happen to openfl

I just upgraded from OpenFL 3.6.1 and Lime 2.9.1 to the latest and I still have good fps. Maybe you need to update hxcpp and/or haxe? I’m using hxcpp 3.4.64 and haxe 3.4.6.

i try all that but it is too slow and amost every line of code crash.

10 FPS on C++, or on Neko? Are you using a framework (like Flixel), or using OpenFL directly? Do you use cacheAsBitmap or filters?

Openfl directly, whem i activate flag hardware = true, the fps drops like 10 fps,

new openfl change the way sprite.graphics.draw works? because i use a lot that, and a lots of sprite on scene, like 1 sprite for every tile. Openfl 4.2.0 run really nice, but i need to make this works on new openfl so i can use the fixed SampleDataEvent for music.