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

Compilation fails in Sys.cpp on mingw/windows #789

Open
ciscoheat opened this issue May 4, 2019 · 0 comments · May be fixed by HaxeFoundation/HaxeManual#537
Open

Compilation fails in Sys.cpp on mingw/windows #789

ciscoheat opened this issue May 4, 2019 · 0 comments · May be fixed by HaxeFoundation/HaxeManual#537

Comments

@ciscoheat
Copy link

On Win 10, after installing the haxelib minimingw I'm setting the environment variable toolchain=mingw and try to compile a project with:

> haxe -cpp bin/cpp -D HXCPP_VERBOSE -lib travix -lib dataclass tests.hxml

tests.hxml:

-lib buddy
-lib deepstate
-cp ./tests/
-cp ./src/
-main Tests2

But it eventually fails with:

haxelib run hxcpp Build.xml haxe -DHXCPP_VERBOSE="1" -Dasynctools="0.1.0" -Dbuddy="2.10.0" -Dbuddy-colors="1" -Dbuddy_colors="1" -Ddataclass="1.5.1" -Ddataclass-date-auto-conversion="1" -Ddataclass_date_auto_conversion="1" -Ddeepstate="0.13.2" -Dhaxe3="1" -Dhaxe4="1" -Dhaxe_ver="4.000" -Dhxcpp_api_level="400" -Dpromhx="1.1.0" -Dpure="1" -Dsource-header="Generated by Haxe 4.0.0-rc.2+77068e10c" -Dstatic="1" -Dtarget.name="cpp" -Dtarget.static="true" -Dtarget.sys="true" -Dtarget.threaded="true" -Dtarget.utf16="true" -Dtink_chunk="0.2.0" -Dtink_cli="0.4.1" -Dtink_core="1.21.0" -Dtink_io="0.6.2" -Dtink_macro="0.17.4" -Dtink_streams="0.3.2" -Dtink_stringly="0.3.1" -Dtravix="0.12.2" -Duse-rtti-doc="1" -Duse_rtti_doc="1" -Dutf16="1" -I"./src/" -I"./tests/" -I"E:\\Projects\\Haxe\\deepstate\\src\\" -I"e:\\Program\\HaxeToolkit\\haxe\\lib\\promhx/1,1,0/src/main/" -I"E:\\Projects\\Haxe\\asynctools\\src\\" -I"e:\\Projects\\Haxe\\buddy\\src\\" -I"e:\\Projects\\Haxe\\dataclass\\src\\" -I"e:\\Program\\HaxeToolkit\\haxe\\lib\\tink_stringly/0,3,1/src/" -I"e:\\Program\\HaxeToolkit\\haxe\\lib\\tink_macro/0,17,4/src/" -I"e:\\Program\\HaxeToolkit\\haxe\\lib\\tink_core/1,21,0/src/" -I"e:\\Program\\HaxeToolkit\\haxe\\lib\\tink_streams/0,3,2/src/" -I"e:\\Program\\HaxeToolkit\\haxe\\lib\\tink_chunk/0,2,0/src/" -I"e:\\Program\\HaxeToolkit\\haxe\\lib\\tink_io/0,6,2/src/" -I"e:\\Program\\HaxeToolkit\\haxe\\lib\\tink_cli/0,4,1/src/" -I"E:\\Projects\\Haxe\\travix\\src\\" -I"E:\\Program\\HaxeToolkit\\haxe\\extraLibs/" -I"" -I"E:\\Program\\HaxeToolkit\\haxe\\std/cpp/_std/" -I"E:\\Program\\HaxeToolkit\\haxe\\std/"
 __
/\ \
\ \ \___    __  _   ___   _____   _____
 \ \  _ `\ /\ \/'\ /'___\/\ '__`\/\ '__`\
  \ \ \ \ \\/>  <//\ \__/\ \ \L\ \ \ \L\ \
   \ \_\ \_\/\_/\_\ \____\\ \ ,__/\ \ ,__/
    \/_/\/_/\//\/_/\/____/ \ \ \/  \ \ \/
                            \ \_\   \ \_\
                             \/_/    \/_/

hxcpp (Haxe C++ Runtime Support) (4.0.8)

Using makefile: Build.xml
Reading HXCPP config: C:\Users\thedc\.hxcpp_config.xml
{}Using target toolchain: mingw

 - Parsing include: e:/Program/HaxeToolkit/haxe/lib/hxcpp/4,0,8/toolchain/setup.xml
 - Parsing include: C:\Users\thedc\.hxcpp_config.xml (section "vars")
 - Parsing include: e:/Program/HaxeToolkit/haxe/lib/hxcpp/4,0,8/toolchain/finish-setup.xml
 - Parsing makefile: E:\Projects\Haxe\dataclass\bin\cpp\Build.xml
 - Parsing include: e:/Program/HaxeToolkit/haxe/lib/hxcpp/4,0,8/build-tool/BuildCommon.xml
 - Parsing include: e:/Program/HaxeToolkit/haxe/lib/hxcpp/4,0,8/toolchain/haxe-target.xml
 - Parsing include: e:/Program/HaxeToolkit/haxe/lib/hxcpp/4,0,8/src/hx/libs/regexp/Build.xml
 - Parsing include: e:/Program/HaxeToolkit/haxe/lib/hxcpp/4,0,8/src/hx/libs/std/Build.xml
 - Parsing include: e:/Program/HaxeToolkit/haxe/lib/hxcpp/4,0,8/toolchain/mingw-toolchain.xml
Using haxelib version of MinGW, e:\Program\HaxeToolkit\haxe\lib\minimingw/1,0,0/
 - Adding path: e:\Program\HaxeToolkit\haxe\lib\minimingw/1,0,0//bin
 - Parsing include: e:/Program/HaxeToolkit/haxe/lib/hxcpp/4,0,8/toolchain/gcc-toolchain.xml
 - Parsing compiler: e:/Program/HaxeToolkit/haxe/lib/hxcpp/4,0,8/toolchain/common-defines.xml
 - Parsing include: C:\Users\thedc\.hxcpp_config.xml (section "exes")

Using compile threads: 8

 - Running command: g++.exe -Iinclude -c -Wno-overflow -O2 -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=400 -DHX_WINDOWS -m32 -Ie:/Program/HaxeToolkit/haxe/lib/hxcpp/4,0,8/include -x c++ -frtti -Wno-invalid-offsetof -std=c++11 ./src/InheritanceTests.cpp -oE:/Projects/Haxe/dataclass/bin/cpp/obj/mingw/a1dd6e32_InheritanceTests.o
 - Running command: g++.exe -Iinclude -c -Wno-overflow -O2 -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=400 -DHX_WINDOWS -m32 -Ie:/Program/HaxeToolkit/haxe/lib/hxcpp/4,0,8/include -x c++ -frtti -Wno-invalid-offsetof -std=c++11 ./src/OptionObjTest.cpp -oE:/Projects/Haxe/dataclass/bin/cpp/obj/mingw/a1dd6e32_OptionObjTest.o
 - Running command: g++.exe -Iinclude -c -Wno-overflow -O2 -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=400 -DHX_WINDOWS -m32 -Ie:/Program/HaxeToolkit/haxe/lib/hxcpp/4,0,8/include -x c++ -frtti -Wno-invalid-offsetof -std=c++11 ./src/OptionTest.cpp -oE:/Projects/Haxe/dataclass/bin/cpp/obj/mingw/a1dd6e32_OptionTest.o
 - Running command: g++.exe -Iinclude -c -Wno-overflow -O2 -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=400 -DHX_WINDOWS -m32 -Ie:/Program/HaxeToolkit/haxe/lib/hxcpp/4,0,8/include -x c++ -frtti -Wno-invalid-offsetof -std=c++11 ./src/DynamicAccessTest.cpp -oE:/Projects/Haxe/dataclass/bin/cpp/obj/mingw/a1dd6e32_DynamicAccessTest.o
 - Running command: g++.exe -Iinclude -c -Wno-overflow -O2 -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=400 -DHX_WINDOWS -m32 -Ie:/Program/HaxeToolkit/haxe/lib/hxcpp/4,0,8/include -x c++ -frtti -Wno-invalid-offsetof -std=c++11 ./src/ComplexChapter.cpp -oE:/Projects/Haxe/dataclass/bin/cpp/obj/mingw/a1dd6e32_ComplexChapter.o
 - Running command: g++.exe -Iinclude -c -Wno-overflow -O2 -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=400 -DHX_WINDOWS -m32 -Ie:/Program/HaxeToolkit/haxe/lib/hxcpp/4,0,8/include -x c++ -frtti -Wno-invalid-offsetof -std=c++11 ./src/SimpleChapter.cpp -oE:/Projects/Haxe/dataclass/bin/cpp/obj/mingw/a1dd6e32_SimpleChapter.o
 - Running command: g++.exe -Iinclude -c -Wno-overflow -O2 -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=400 -DHX_WINDOWS -m32 -Ie:/Program/HaxeToolkit/haxe/lib/hxcpp/4,0,8/include -x c++ -frtti -Wno-invalid-offsetof -std=c++11 ./src/Tests2.cpp -oE:/Projects/Haxe/dataclass/bin/cpp/obj/mingw/a1dd6e32_Tests2.o
 - Running command: g++.exe -Iinclude -c -Wno-overflow -O2 -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=400 -DHX_WINDOWS -m32 -Ie:/Program/HaxeToolkit/haxe/lib/hxcpp/4,0,8/include -x c++ -frtti -Wno-invalid-offsetof -std=c++11 ./src/Document.cpp -oE:/Projects/Haxe/dataclass/bin/cpp/obj/mingw/a1dd6e32_Document.o
 - Running command: g++.exe -Iinclude -c -Wno-overflow -O2 -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=400 -DHX_WINDOWS -m32 -Ie:/Program/HaxeToolkit/haxe/lib/hxcpp/4,0,8/include -x c++ -frtti -Wno-invalid-offsetof -std=c++11 ./src/Validator.cpp -oE:/Projects/Haxe/dataclass/bin/cpp/obj/mingw/a1dd6e32_Validator.o
 - Running command: g++.exe -Iinclude -c -Wno-overflow -O2 -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=400 -DHX_WINDOWS -m32 -Ie:/Program/HaxeToolkit/haxe/lib/hxcpp/4,0,8/include -x c++ -frtti -Wno-invalid-offsetof -std=c++11 ./src/DefaultValue.cpp -oE:/Projects/Haxe/dataclass/bin/cpp/obj/mingw/a1dd6e32_DefaultValue.o
 - Running command: g++.exe -c -Wno-overflow -O2 -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=400 -DHX_WINDOWS -m32 -Ie:/Program/HaxeToolkit/haxe/lib/hxcpp/4,0,8/include -x c++ -frtti -Wno-invalid-offsetof -std=c++11 e:/Program/HaxeToolkit/haxe/lib/hxcpp/4,0,8/src/hx/libs/std/Sys.cpp -oE:/Projects/Haxe/dataclass/bin/cpp/obj/mingw/28a13fcb_Sys.o
 - Running command: g++.exe -c -Wno-overflow -O2 -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=400 -DHX_WINDOWS -m32 -Ie:/Program/HaxeToolkit/haxe/lib/hxcpp/4,0,8/include -x c++ -frtti -Wno-invalid-offsetof -std=c++11 e:/Program/HaxeToolkit/haxe/lib/hxcpp/4,0,8/src/hx/libs/std/File.cpp -oE:/Projects/Haxe/dataclass/bin/cpp/obj/mingw/28a13fcb_File.o

Error: Error while running command
g++.exe -c -Wno-overflow -O2 -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=400 -DHX_WINDOWS -m32 -Ie:/Program/HaxeToolkit/haxe/lib/hxcpp/4,0,8/include -x c++ -frtti -Wno-invalid-offsetof -std=c++11 e:/Program/HaxeToolkit/haxe/lib/hxcpp/4,0,8/src/hx/libs/std/Sys.cpp -oE:/Projects/Haxe/dataclass/bin/cpp/obj/mingw/28a13fcb_Sys.o

e:/Program/HaxeToolkit/haxe/lib/hxcpp/4,0,8/src/hx/libs/std/Sys.cpp: In function 'void _hx_std_put_env(String, String)':
e:/Program/HaxeToolkit/haxe/lib/hxcpp/4,0,8/src/hx/libs/std/Sys.cpp:97:28: error: 'putenv' was not declared in this scope
    bool ok = putenv(set.__s) == 0;
                            ^
e:/Program/HaxeToolkit/haxe/lib/hxcpp/4,0,8/src/hx/libs/std/Sys.cpp: In function 'String _hx_std_get_cwd()':
e:/Program/HaxeToolkit/haxe/lib/hxcpp/4,0,8/src/hx/libs/std/Sys.cpp:180:41: warning: NULL used in arithmetic [-Wpointer-arith]
    if( GetCurrentDirectoryW(260,buf) == NULL )
                                         ^
e:/Program/HaxeToolkit/haxe/lib/hxcpp/4,0,8/src/hx/libs/std/Sys.cpp: In function 'Array<String> _hx_std_sys_env()':
e:/Program/HaxeToolkit/haxe/lib/hxcpp/4,0,8/src/hx/libs/std/Sys.cpp:722:15: error: 'environ' was not declared in this scope
    char **e = environ;
               ^
Error: Build failed

Since the errors happen in Sys.cpp, I'm at a loss here. Let me know if you need anything else!

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

Successfully merging a pull request may close this issue.

1 participant