HaxeFoundation / hxcpp

Runtime files for c++ backend for haxe
Other
298 stars 191 forks source link

Could not automatically setup MSVC #533

Closed ovidiugabriel closed 8 years ago

ovidiugabriel commented 8 years ago

Hello, I want to build a Haxe project with hxcpp and gcc. I don't know why it is trying to find MSVC, because I have g++/gcc installed.

Information:11/10/2016 7:59 PM - Compilation completed with 3 errors and 0 warnings in 1 sec
Error:Compilation failed
C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 14.0.5\jre\jre\bin
Information:haxelib run hxcpp Build.xml haxe -Dhaxe3="1" -Dhaxe_ver="3.201" 
  -Dhxcpp_api_level="321" -I"C:/Users/ovidiu/Server/src/" 
  -I"C:\\HaxeToolkit\\haxe\\extraLibs/" -I"" -I"C:\\HaxeToolkit\\haxe\\std/cpp/_std/"
  -I"C:\\HaxeToolkit\\haxe\\std/"
Information:C:\Users\ovidiu\Server\out\production\Server\release\.exe>setlocal 
  enabledelayedexpansion
Error:Could not automatically setup MSVC
Information:Warning: Could not find environment variables for Visual Studio
Information:Missing HXCPP_VARS
Error:Build failed

Here is the gcc installation.

C:\Users\ovidiu>g++ --version
g++ (i686-posix-dwarf-rev0, Built by MinGW-W64 project) 5.3.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

What I can do to switch to build with gcc?

madrazo commented 8 years ago

Hi. I have never used mingw but a quick search in Haxe's google groups got this

Hi, The build-tool uses this logic:

defines.exists("mingw") || env.exists("HXCPP_MINGW")

so you can use -Dmingw or set it in hxcpp_config <set name="mingw" value="1' />

or set HXCPP_MINGW in your computer environment.

Hugh

I think that it still appliies. Cheers

ovidiugabriel commented 8 years ago

Thanks a lot. This worked.

set HXCPP_MINGW=1
set MINGW_ROOT=C:\Qt\Tools\mingw530_32
zikaura commented 2 years ago

I'm having this same issue but I do have MSVC installed via Visual Studio 2019 Build Tools . Any advice would be really appreciated.

ovidiugabriel commented 2 years ago

Hello @zikorano, do you want to use msvc or gcc? On windows platforms msvc is selected by default, to use gcc you have to set the HXCPP_MINGW environment variable in build.sh (your shell script).