-
Notifications
You must be signed in to change notification settings - Fork 46
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
[Help Request] Cross-compiling windows build from Linux #26
Comments
Windows mingw in Wine is what I do. If it looks stupid but works, it ain't stupid. I've never tried an actual cross compiler.
|
Currently it spits out no output and generates a single file named a.exe. I'll keep poking at it and post back here if I have any luck. |
Yeah, a.exe is mingw's default output filename. Rename it to flips.exe. |
Sorry, I should have been more clear. That file generates errors when run via wine. Didn't get that part written.
|
Yeah, mingw programs usually need those dlls. I wrote some tricky code so they're not needed with my compiler, but I'm not sure if that trick works elsewhere. Attach your binary and I'll see if I can identify and delete them. Alternatively, you should have those dlls somewhere in your mingw installation; look them up and put them beside the exe. |
Ah, you're correct. Based on which dlls were requested I was thinking it compiled some intermediate part and stopped. Symlinked those in and it's fine. That said, if you can indeed bypass needing them, that'd be better, since combined they're about 16MiB. |
objdump -p a.exe
(plus a few thousand lines of uninteresting stuff) If all uses of these functions are deleted, the DLLs will go away too. Unwind and personality is exceptions - to get rid of that, compile with -fno-exceptions. Flips doesn't use exceptions anyways. ZTVN is typeid and dynamic_cast. Flips doesn't need that either; to opt out, -fno-rtti. Zdl is a C++14 thing. Fixed in latest commit, or you can use -std=c++11 or c++98. I also added a #warning recommending -fno-exceptions/no-rtti; this should avoid a few future instances of this issue. |
Beautiful. Thank you. Final commands: 32-bit: 64-bit: EDIT: Added the output filename and 32-bit variant just for kicks. Works like a charm. |
Normally I avoid making this sort of issue, but I'm having no luck thus far. I'm looking to be able to compile the windows executable from Linux, but have no familiarity with mingw. Is there some easy way to accomplish this? My specific interest in this case is in making the -I flag available to Winfolk I work with on the retroachievements platform.
I have a feeling as a last resort I could use the windows mingw from within wine, but that feels extremely unnecessary.
The text was updated successfully, but these errors were encountered: