| Issue 3: | add MinGW support for Win Platform | |
| 4 people starred this issue and may be notified of changes. | Back to list |
How about to support compiling hxcpp with MinGW
Aug 2, 2010
Project Member
#1
gameh...@gmail.com
Status:
WontFix
Dec 16, 2010
Here is a patch to use gcc if run under Msys (mingw shell) or Cygwin. The patch checks 'uname -o' if the os is windows, to see if it is a unix subsystem. Under cygwin, because gcc/g++ may be a cygwin-specific symlink, it also tries g++-4 and g++-3. Two new toolchains are added. Additionally, I had to change some of the preprocessor conditions in the thread sources to check for HX_WINDOWS instead of _MSC_VER. This patch works for me, but I have all 3 dev environments installed (msvc, msys, cygwin), so it's possible others run into something missing I did not. Try it out.
Dec 16, 2010
I use patch width last svn version of hxcpp and get this error in atached in image. I use haxe 2.06
Dec 16, 2010
Hi rajabiy, thank you for testing. It seems the compile thread throws an error but does not say what it is. Is there any useful information in your 1.log file?
Dec 16, 2010
Note that after applying the patch you must recompile the build tool with build-tool/Compile.hxml
Dec 16, 2010
In other computer. I get this. $ haxe -cp src -cpp bin -debug -main Main haxelib run hxcpp Build.xml haxe -Ddebug -Dcpp -Ddebug -Dhaxe_205 -Dtrue gcc.exe -Iinclude -c -g -O2 -DHX_WINDOWS -DHX_LINUX -DHXCPP_DEBUG -m32 -IC:\Program Files\Motion-Twin\haxe\lib\hxcpp\2,05,1//include -frtti ./src/cpp/Lib.cpp -oobj/mingw-dbg//src/cpp/Lib.o gcc.exe -Iinclude -c -g -O2 -DHX_WINDOWS -DHX_LINUX -DHXCPP_DEBUG -m32 -IC:\Program Files\Motion-Twin\haxe\lib\hxcpp\2,05,1//include -frtti ./src/Std.cpp -oobj/mingw-dbg//src/Std.o In file included from ./src/Std.cpp:4:0: include/Std.h: In member function 'virtual String Std_obj::__ToString() const': include/Std.h:28:58: error: 'HX_STRING' was not declared in this scope In file included from ./src/cpp/Lib.cpp:4:0: include/cpp/Lib.h: In member function 'virtual String cpp::Lib_obj::__ToString() const': include/cpp/Lib.h:27:58: error: 'HX_STRING' was not declared in this scope ./src/Std.cpp: In static member function 'static String Std_obj::string(Dynamic)': ./src/Std.cpp:37:54: error: 'HX_STRING' was not declared in this scope ./src/Std.cpp: In static member function 'static double Std_obj::parseFloat(String)': ./src/Std.cpp:65:36: error: invalid conversion from 'const HX_CHAR*' to 'int' ./src/Std.cpp:65:36: error: initializing argument 1 of 'String::String(const int&)' ./src/Std.cpp: At global scope: ./src/Std.cpp:121:19: error: 'HX_STRING' was not declared in this scope ./src/Std.cpp:122:23: error: 'HX_STRING' was not declared in this scope ./src/Std.cpp:123:20: error: 'HX_STRING' was not declared in this scope ./src/Std.cpp:124:25: error: 'HX_STRING' was not declared in this scope ./src/Std.cpp:125:28: error: 'HX_STRING' was not declared in this scope ./src/Std.cpp:126:23: error: 'HX_STRING' was not declared in this scope ./src/Std.cpp: In static member function 'static void Std_obj::__register()': ./src/Std.cpp:139:57: error: 'HX_STRING' was not declared in this scope ./src/cpp/Lib.cpp: At global scope: ./src/cpp/Lib.cpp:238:21: error: 'HX_STRING' was not declared in this scope ./src/cpp/Lib.cpp:239:25: error: 'HX_STRING' was not declared in this scope ./src/cpp/Lib.cpp:240:24: error: 'HX_STRING' was not declared in this scope ./src/cpp/Lib.cpp:241:33: error: 'HX_STRING' was not declared in this scope ./src/cpp/Lib.cpp:242:22: error: 'HX_STRING' was not declared in this scope ./src/cpp/Lib.cpp:243:28: error: 'HX_STRING' was not declared in this scope ./src/cpp/Lib.cpp:244:28: error: 'HX_STRING' was not declared in this scope ./src/cpp/Lib.cpp:245:24: error: 'HX_STRING' was not declared in this scope ./src/cpp/Lib.cpp: In static member function 'static void cpp::Lib_obj::__register()': ./src/cpp/Lib.cpp:258:61: error: 'HX_STRING' was not declared in this scope Called from <null> line 1 Called from BuildTool.hx line 1013 Called from BuildTool.hx line 451 Called from BuildTool.hx line 478 Called from BuildTool.hx line 588 Called from BuildTool.hx line 660 Uncaught exception - Error in building thread Error : Build failed
Dec 16, 2010
Please use the svn version of hxcpp
Jan 23, 2011
Нello. I just copied svn code to real installed lib (with replace) - F:\bin\haxe\lib\hxcpp\2,06,1 And i got error on compiling test project. Building test1 haxe -cp src -cpp bin -debug -D mingw -main Main haxelib run hxcpp Build.xml haxe -Ddebug -Dcpp -Ddebug -Dhaxe_206 -Dmingw -Dtrue BuildTool.hx:154: Creating hxcpp.h.gch. F:\bin\MinGW/bin/g++.exe -Iinclude -c -g -O2 -DHX_WINDOWS -DHXCPP_DEBUG -m32 -IF:\bin\haxe\lib\hxcpp\2,06,1//include -frtti -o hxcpp.h.gch F:\bin\haxe\lib\hxcpp\2,06,1//include/hxcpp.h F:\bin\MinGW/bin/g++.exe -I. -Iinclude -c -g -O2 -DHX_WINDOWS -DHXCPP_DEBUG -m32 -IF:\bin\haxe\lib\hxcpp\2,06,1//include -x c++ -frtti ./src/cpp/Lib.cpp -oobj/mingw-debug//src/cpp/Lib.o F:\bin\MinGW/bin/g++.exe -I. -Iinclude -c -g -O2 -DHX_WINDOWS -DHXCPP_DEBUG -m32 -IF:\bin\haxe\lib\hxcpp\2,06,1//include -x c++ -frtti ./src/Std.cpp -oobj/mingw-debug//src/Std.o In file included from ./src/cpp/Lib.cpp:4:0: include/cpp/Lib.h:4:19: fatal error: ./hxcpp.h: No such file or directory compilation terminated. Called from ? line 1 Called from BuildTool.hx line 1123 Called from BuildTool.hx line 509 Called from BuildTool.hx line 538 Called from BuildTool.hx line 652 Called from BuildTool.hx line 724 Uncaught exception - Error in building thread Error : Build failed In file included from ./src/Std.cpp:4:0: include/Std.h:4:19: fatal error: ./hxcpp.h: No such file or directory compilation terminated. Build halted with errors (haxe.exe).
Jan 23, 2011
Hi, It works ok for me here, so it is probably just something with the setup. What version of mingw are you using? c:/MinGW/bin/g++.exe --ver I get 4.5.0 It looks something to do with include paths. You could try removing the "precompile" line: <set name="USE_PRECOMPILED_HEADERS" value="gcc"/> from hxc[[/build-tools/gcc-toolchain.xml And see if that does the trick. Finally, you could try setteng the HXCPP variable explicitly to: f:/bin/haxe/lib/hxcpp/2,06,1/ via your shell or advanced computer settings. Also, I assume this directory exists and includes "include/hxcpp.h" To set hxcpp to the svn version, I usually download the svn version and then use "haxelib dev hxcpp path_to_svn_version", which saves some copying.
Status:
Fixed
Jan 24, 2011
mingw version - 4.5.0 I removed the "precompile" line and it works. Thanks. |