Problem building for windows

Hi, I just installed HaxeDevelop and started using it with the current versions of haxe/lime/openfl. I created a simple OpenFL project for testing and hwen I try to build it for the Windows target, I get this error:

Error: 64bit is not automatically supported for this version of VC. Set HXCPP_MSVC_CUSTOM and manually configure the executable, library and include paths

It works fine for Flash or Neko. What can I do to solve it?

Another question: this seems a 32/64bit target issue, right? I want to have my executable running on 32bit systems (even if I’m using a 64bit machine to build it). What can I do to adjust it?

What version of Visual Studio?

Try openfl test windows -32

the results

C:\Users\choki\Documents\Code\Haxe\AutoUpdate>openfl test windows -32
C:\Users\choki\Documents\Code\Haxe\AutoUpdate\bin\windows\obj>setlocal enabledelayedexpansion
Warning: Could not find environment variables for Visual Studio
Missing HXCPP_VARS
Error: Could not automatically setup MSVC

without “-32”

C:\Users\choki\Documents\Code\Haxe\AutoUpdate>openfl test windows
C:\Users\choki\Documents\Code\Haxe\AutoUpdate\bin\windows\obj>setlocal enabledelayedexpansion
Error: 64bit is not automatically supported for this version of VC. Set HXCPP_MSVC_CUSTOM and manually configure the executable, library and include paths
Error: Error: 64bit is not automatically supported for this version of VC. Set HXCPP_MSVC_CUSTOM and manually configure the executable, library and include paths

Did you install Visual Studio Community with Win32/C++ support enabled, and reboot afterward?

oops, the restart!
everything is working fine now. thank you a lot!

I have the same problem. I’m trying to build in FlashDevelop my old Haxe-cpp project that I have built on windows, ubuntu and android a year or two ago. Nothing have been changed from that times. But now I have such diagnostics of errors:

Running process: C:\Program Files (x86)\FlashDevelop\Tools\fdbuild\fdbuild.exe "C:\Users\meps\Documents\work\haxe\pokertool\pokertools\pokertools.hxproj" -ipc 6d239c28-3952-4827-b045-87b5e8152f02 -version "3.4.2" -compiler "C:\HaxeToolkit\haxe" -notrace -library "C:\Program Files (x86)\FlashDevelop\Library"
Building pokertools
haxe  -cp src -cp ../sources -cpp C:/Users/meps/Documents/work/haxe/pokertool/pokertools/bin -main com.rapilli.pc.CPokerTools
haxelib run hxcpp Build.xml haxe -Dhaxe3="1" -Dhaxe_ver="3.402" -Dhxcpp_api_level="331" -Dsource-header="Generated by Haxe 3.4.2 (git build master @ 890f8c7)" -I"../sources/" -I"src/" -I"C:\\HaxeToolkit\\haxe\\extraLibs/" -I"" -I"C:\\HaxeToolkit\\haxe\\std/cpp/_std/" -I"C:\\HaxeToolkit\\haxe\\std/"
C:\Users\meps\Documents\work\haxe\pokertool\pokertools\bin>setlocal enabledelayedexpansion 
Warning: Could not find environment variables for Visual Studio
Missing HXCPP_VARS
Error: Could not automatically setup MSVC
Error: Build failed
Build halted with errors (haxe.exe).
Done(1)

I don’t know how to fix it. I have installed FlashDevelop and HaxeToolkit on my work computer and have the same diagnostics there. MSVC 2010 redistributable is have been set on both computers.

What version of Visual Studio do you have installed, and what version of HXCPP and OpenFL and Lime are you using?

Wow, I have a zoo of MSVCs – 2005 (x86 & x64) 8.0.61001, 2010 (x86 & x64) 10.0.40219, 2015 (x86 & x64) 14.0.24212.0. Should I remove all and install only one? BTW I have almost the same bunch of MSVCs at work.
hxcpp - 4.0.4
lime - 7.1.1
openfl - 8.5.1
At home I’m using Windows 8.1, at work Windows 10.
Dos command set HXCPP_VARS says that environment variable is undefined.

I suppose that problem is not in libraries – something went wrong with haxe compiler or probably environment.

@meps I commented out this code in the 7.1.1 release:

This used to force an older MSVC if found, but current HXCPP releases should work with Visual Studio Community. We want the default to use the latest available unless you choose to set the MSVC version yourself

I have reinstalled MS VS Community and now everything works fine.

1 Like

I use visual studio 2019 and 2017 i didn’t have haxedevelop but i couldn’t build for windows

I have the 2022 version how I do ?

Sorry for the late reply, but this video by @Dimensionscape got me going with VSCode. I did have Visual Studio 2019 already installed, which if I recall correctly was required for MSVC (for HaxeDevelop compiling).