OpenFL + hxcpp throws error

Hello!

I am new in haxe, just trying to check out openfl performance. When I am trying to compile openfl example(PiratePig) for windows not via neko, g++ throws error to me:

E:\dev\haxe\PiratePig>openfl build windows
g++.exe -o ApplicationMain.exe -Wl,–enable-auto-import -m32 -Lc:/MinGW/lib/libs
@obj/mingw-nc//all_objs
g++.exe: @obj/mingw-nc//all_objs: No such file or directory
Error: error running g++.exe -o ApplicationMain.exe -Wl,–enable-auto-import -m3
2 -Lc:/MinGW/lib/libs @obj/mingw-nc//all_objs

Is it bug or i am doing it wrong?

Installed libs:
actuate: [1.8.0]
hxcpp: [3.1.48]
lime: [2.0.4]
nme: [5.2.7]
openfl-samples: [2.2.0]
openfl: [2.2.1]

Okay, problem solved. Before to use hxcpp you need to compile it even if it were installed via haxelib.

Wow, I’ve never tried mingw32 with HXCPP before, it works fine?

Yea, it works and even playable! :wink:

Hi, how did you manage to direct openfl to use mingw? when I do “openfl setup windows” in my windows machine, it tries to download vs c++ 2010.

HXCPP looks for Visual Studio (almost any version) automatically. You don’t need to run “setup”, but it is there as a convenience function to help a fresh system have what it needs to build :smile:

I think HXCPP might recognize -Dmingw (or something like that) to switch compilers

I will try to use -Dmingw when I get home :smile:

Right now I am trying to do a cross-compile manually using mingw32. If I get successful maybe we could push this to either openfl or hxcpp.

But it used MinGW too haxelib install minimingw But it need to install MinGW32 or MinGW64 I suggest very better for TDM-GCC 32 / 64 better than normal MinGW because normal MinGW hasn’t installation of Bit 64. That is why hard to manage MinGW to Bit 64. Better use TDM-GCC!

If you want use to MinGW you need hxcpp/version-number/toolchain/*.xml replace to gcc, ld, make and more. Just find simple configure of Linux. You should replace to MinGW-Path. But I don’t know - I will test with MinGW32/64 or @singmajesty can you target “mingw-windows” next release with MinGW cross compiler? If you decide? Or are you developer of openfl?

hi, I think, there would be no need to replace gcc’s there, we were able to update HXCPP to work with mingw, and even cross compile from Linux to Windows32 and 64bit.

If you would want to take advantage if this, you got to update Lime source code a bit.

Yes but I have problem cross-compilers for windows from Ubuntu.- But it still show error after generated app to open “Null Function Pointer” :frowning:

How do I fix it? I think mingw under Windows has not problem because mingw has correct binary format upx executable of Windows. And from Ubuntu has wrong format like call to script it didn’t load to binary format of upx executable.

Example: I have written:
cd HelloWorld
lime build linux -Dwindows -Dmingw
After generating progress

"x86-x64-mingw-w64-g++ -Wall -o myapp.exe -L’objs/mingw12345/’ …
Please do not forget to remove "-lpthread -ldl because they don’t have features of mingw w64 g++.

Than I try to open myapp.exe in wine It shows error message “Null Function Pointer” Why does it not work?

Thanks for understanding

You are Building Linux app while calling -Dmingw, I have not tried that yet, When you do

lime build linux

it builds you a Linux App, you could call instead,

lime build windows -Dmingw

That way, it will call on Windows compiling chain in Lime and calling Mingw compiler to do the Job. Try and see if that works.