Can not build for windows


#1

Hi when creating exe file for windows, i had this error (i have VS community installed on my machine C:\Program Files (x86)\Microsoft Visual Studio )
Warning: Could not find Visual Studio 2017 VsDevCmd
Missing HXCPP_VARS
Error: Could not automatically setup MSVC
Build halted with errors.

msvc-setup.bat (using hxcpp 4.0.4)

setting up for windows
1

project.xml

<!-- classpath, haxe libs -->
<source path="src" />
<source path="lib" />
<haxelib name="openfl" />
<haxelib name="starling" />
<!-- assets -->
<icon path="assets/openfl.svg" />
<assets path="assets/img" rename="img" embed="false"/>
<assets path="assets/sounds" rename="sounds" embed="false"/>
<assets path="assets/fonts" rename="fonts" embed="false"/>

Any help would be appreciated. Thanks!


#2

What version of Visual Studio Community is installed?

Have you restarted the machine since the install, or at least closed and re-opened the command-prompt? Sometimes, environment variables do not update until after a reboot.


#3

hi singmajesty. i have updated my vs community to the lastest version and ran the command line after my computer is restarted. is there any way to set environment variables manually?.


#4

What is your “C:\Program Files (x86)\Microsoft Visual Studio” folder like? Does it have a “2017” folder, or an “Installer\vswhere.exe” executable?


#5

hi @singmajesty
Yes, it does, it has a “2017” folder. the full paths are C:\Program Files (x86)\Microsoft Visual Studio\2017\Community and C:\Program Files (x86)\Microsoft Visual Studio\Installer. Just tried to run command line (lime setup windows) again but still have no luck. I’m using lime ver 7.2.1.


#6

Oh, interesting

It looks like it is using vswhere.exe, not falling through to the VS Community 2017 exact path below in “msvc-setup.bat”

Could you try running C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe -latest -products and see what it returns?

Did you check the boxes in the Visual Studio install for Windows Desktop (Win32) C++?


#7

Hi singmajesty

  • while running vswhere.exe, i have this info.
  • I’ve uninstalled VS and all visual C++ components on my machine, then re-install new VS Community 2017 with just Windows Desktop (Win32) checked.

    and sadly I’m not able to run command line to set up for windows build. thanks for your time!

#8

I found this http://forum.haxeflixel.com/topic/723/haxeflixel-and-ms-build-tools. Some devs had same issues while building for Windows with VS Community 2017. I guess Lime works well with VS 2015?


#9

This is an HXCPP issue, not a Lime/OpenFL issue, but it is curious because I use Visual Studio Community 2017 myself :confused:


#10

Any news about this issue? hxcpp has been updated to version 4.0.8 but the problem is still there. :frowning:


#11

Hi! I get it working with hxcpp 3.4.64 lime 6.2.0 openfl 7.1.2 but I had another error while building.
" Error: pcre_exec.c
C:/HaxeToolkit/haxe/lib/hxcpp/3,4,64/project/thirdparty/pcre-7.8/pcre_exec.c : fatal error C1033: cannot open program database ‘e:\cloud\dropbox\haxestarlingtest\bin\windows\obj\obj\msvc16-debug-ncxp\vc.pdb’"
Any suggestions? Thanks!


#12

After restarting computer and clean all old windows build, it works well. Thanks for reading!
ah, just another question. is it safe if we use haxe starling along with old version of openfl and lime? i love starling api and it’s assetmanager, bitmap font:)


#13

Sure! I think it should work fine. Let me know if you have issues :smile: