openFL to windows fatal error: cannot open typeinfo.h

I cannot compile any project to windows on my windows 10 laptop (works fine on my win8 stationary though), and I have no idea where to even begin… so I begin by posting here =)

Just did an haxelib upgrade to openFL 4.0.0 and lime 3.0.0, but the error message is the same as before.

Here is from my cygwin terminal:

$ openfl test windows -clean
Creating C:/dev/haxe/testOpenFL/bin/windows/cpp/release/obj/obj/msvc16-ncxp/__pch/haxe/hxcpp.pch...
hxcpp.cpp
c:/sdk/haxe/hxcpp/3,3,49/include\hxcpp.h(16) : fatal error C1083: Cannot open include file: 'typeinfo.h': No such file or directory
Error: error running cl.exe -Iinclude -nologo -DHX_WINDOWS -GR -O2 -Oy- -c -EHs -GS- -arch:SSE -Ic:/sdk/haxe/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 -MT -Ychxcpp.h -Yllinkb43ec9d3a0658629c750ea819ba4bd7b C:/dev/haxe/testOpenFL/bin/windows/cpp/release/obj/obj/msvc16-ncxp/__pch/haxe/hxcpp.cpp /FpC:/dev/haxe/testOpenFL/bin/windows/cpp/release/obj/obj/msvc16-ncxp/__pch/haxe/hxcpp.pch -FoC:/dev/haxe/testOpenFL/bin/windows/cpp/release/obj/obj/msvc16-ncxp/__pch/haxe/hxcpp.obj

Anyone have any ideas on how to proceed?

Maybe try openfl rebuild hxcpp windows, and if have issues after that, openfl rebuild windows?

Thanks for your reply! I had missed the rebuild command, so I tried it for the first time.
However it did not work.

The openfl rebuild hxcpp windows generates an error saying that stddef.h cannot be found (full output below).
The openfl rebuild windows works without errors but trying to rebuild hxcpp windows yields a slightly different output, however the error is still that stddef.h is missing.

Worth noting is that I have been able to build to windows before, but I haven’t coded in haxe on the laptop for a while now.

Here is the long error output.

$ openfl rebuild hxcpp windows
 - Compiling group 'std' with flags -nologo -DHX_WINDOWS -GR -O2(optim-std) -Zi(debug) -Fdc:\sdk\haxe\hxcpp\3,3,49\project\obj/msvc16xp/vc.pdb(debug) -Od(debug) -O2(release) -Os(optim-size) -Oy- -c -EHs -GS- -arch:SSE -Ic:/sdk/haxe/hxcpp/3,3,49/include -DHXCPP_VISIT_ALLOCS(haxe) -DHXCPP_API_LEVEL=0(haxe) -D_CRT_SECURE_NO_DEPRECATE -D_ALLOW_MSC_VER_MISMATCH -D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH -wd4996 tags=[haxe,static]
 - Compile : Xml.cpp
 - Compile : Sys.cpp
 - Compile : Process.cpp
Error: While running :cl.exe -nologo -DHX_WINDOWS -GR -O2 -Oy- -c -EHs -GS- -arch:SSE -Ic:/sdk/haxe/hxcpp/3,3,49/include -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=0 -D_CRT_SECURE_NO_DEPRECATE -D_ALLOW_MSC_VER_MISMATCH -D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH -wd4996 -MT c:/sdk/haxe/hxcpp/3,3,49/project/libs/std/Xml.cpp -Foc:/sdk/haxe/hxcpp/3,3,49/project/libs/std/obj/msvc16xp/d6864f50_Xml.obj
Xml.cpp
c:\sdk\haxe\hxcpp\3,3,49\include\hx\OS.h(59) : fatal error C1083: Cannot open include file: 'stddef.h': No such file or directory

Error: While running :cl.exe -nologo -DHX_WINDOWS -GR -O2 -Oy- -c -EHs -GS- -arch:SSE -Ic:/sdk/haxe/hxcpp/3,3,49/include -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=0 -D_CRT_SECURE_NO_DEPRECATE -D_ALLOW_MSC_VER_MISMATCH -D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH -wd4996 -MT c:/sdk/haxe/hxcpp/3,3,49/project/libs/std/Sys.cpp -Foc:/sdk/haxe/hxcpp/3,3,49/project/libs/std/obj/msvc16xp/d6864f50_Sys.obj
Sys.cpp
c:\sdk\haxe\hxcpp\3,3,49\include\hx\OS.h(59) : fatal error C1083: Cannot open include file: 'stddef.h': No such file or directory

Error: While running :cl.exe -nologo -DHX_WINDOWS -GR -O2 -Oy- -c -EHs -GS- -arch:SSE -Ic:/sdk/haxe/hxcpp/3,3,49/include -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=0 -D_CRT_SECURE_NO_DEPRECATE -D_ALLOW_MSC_VER_MISMATCH -D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH -wd4996 -MT c:/sdk/haxe/hxcpp/3,3,49/project/libs/std/Process.cpp Foc:/sdk/haxe/hxcpp/3,3,49/project/libs/std/obj/msvc16xp/d6864f50_Process.obj
Process.cpp
c:\sdk\haxe\hxcpp\3,3,49\include\hx\OS.h(59) : fatal error C1083: Cannot open include file: 'stddef.h': No such file or directory

Perhaps HXCPP broke support for older Visual Studio versions?

^ what this guy says!

Beyond that, I’m out of my depth. The commands I put up earlier are the ones that Joshua has replied in the past, when I made forum posts etc about stuff breaking after updates :stuck_out_tongue:

So maybe try updating Visual Studio? They have a couple of free ones available now.

Your Visual Studio environment variables aren’t set correctly, probably.

I think you can find more info on this issue at the hxcpp repo.

Yes, it seems to be Visual Studio environment stuff.
Cannot find any good documentation about it, and the more I do the worse it seems to get.

The only thing I found that resembles my problem is this

I installed Visual Studio 2015, but still complains.

$ openfl rebuild hxcpp windows
c:\sdk\haxe\hxcpp\3,3,49\project>setlocal enabledelayedexpansion
Warning: Could not find environment variables for Visual Studio
Missing HXCPP_VARS
Error: Could not automatically setup MSVC

Cannot find any info about HXCPP_VARS, and setting HXP_MSVC_VER doesn’t seem to do the trick, so removed and reinstalled hxcpp via haxelib. Still nothing.
Tried to rebuild hxcpp as described here https://github.com/HaxeFoundation/hxcpp

New error message is

$ neko build.n windows
neko run.n Build.xml -Dwindows -DHXCPP_M64 -Dstatic_link C:/sdk/haxe/hxcpp/3,3,49/project/
C:\sdk\haxe\hxcpp\3,3,49\project>setlocal enabledelayedexpansion
Error: 64bit is not autmatically supported for this version of VC. Set HXCPP_MSVC_CUSTOM and manually configure the executable, library and include paths
Error: Error: 64bit is not autmatically supported for this version of VC. Set HXCPP_MSVC_CUSTOM and manually configure the executable, library and include paths
#### Error building neko -Dwindows -DHXCPP_M64 -Dstatic_link

So it got worse, and I still have no idea where to find info about the hxcpp environment variables.
Weird thing is that it used to work once.
I’m clueless on how to proceed =(

If you just installed VS2015, try a restart so that your environment variables are up-to-date

Gaah, of course! I’ve been on this too long.
A restart solved it. Thanks a lot! =)

1 Like