Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not automatically setup MSVC #1010

Closed
zikaura opened this issue Oct 16, 2022 · 2 comments
Closed

Could not automatically setup MSVC #1010

zikaura opened this issue Oct 16, 2022 · 2 comments

Comments

@zikaura
Copy link

zikaura commented Oct 16, 2022

I have MSVC installed via Visual Studio 2019 Build Tools but when I try to build my project I get this error

C:\Users\ACER\Code\Haxe\hx-experiments>
C:\Users\ACER\Code\Haxe\hx-experiments>haxe build.hxml
haxelib run hxcpp Build.xml haxe -Dhaxe="4.2.5" -Dhaxe3="1" -Dhaxe4="1" -Dhaxe_v
er="4.205" -DhxRaylib="4.0.0" -Dhxcpp="4.2.1" -Dhxcpp_api_level="400" -Dhxcpp_sm
art_strings="1" -Dsource_header="Generated by Haxe 4.2.5" -Dstatic="1" -Dtarget.
name="cpp" -Dtarget.static="true" -Dtarget.sys="true" -Dtarget.threaded="true" -
Dtarget.unicode="true" -Dtarget.utf16="true" -Dutf16="1" -I"C:\\HaxeToolkit\\hax
e\\lib\\hxcpp/4,2,1/" -I"C:\\HaxeToolkit\\haxe\\lib\\hxRaylib/4,0,0/src/" -I"src
/" -I"" -I"C:\\HaxeToolkit\\haxe\\extraLibs/" -I"C:\\HaxeToolkit\\haxe\\std/cpp/
_std/" -I"C:\\HaxeToolkit\\haxe\\std/"
C:\Users\ACER\Code\Haxe\hx-experiments\bin>setlocal enabledelayedexpansi
on
Warning: Could not find environment variables for Visual Studio
Missing HXCPP_VARS
Error: Could not automatically setup MSVC
Error: Build failed

The same also happens when I use the VS Developer command prompt

@tobil4sk
Copy link
Member

This is related to: #1008. The hxcpp script relies on vswhere, which is not installed along with the build tools. Also, vswhere doesn't check the build tools by default either You could try one of the solutions suggested in that thread, and set the flag: -D NO_AUTO_MSVC in your haxe compilation and try running in the VS Developer prompt again.

@zikaura
Copy link
Author

zikaura commented Oct 17, 2022

I've installed vswhere manually using chocolatey and it works now. Perhaps this requirement should be in the hxcpp documentation? Either way, thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants