![]() |
Building & cross compiling experience - Printable Version +- Tilengine - The 2D retro graphics engine forum (http://tilengine.org/forum) +-- Forum: English forums (http://tilengine.org/forum/forumdisplay.php?fid=3) +--- Forum: Support (http://tilengine.org/forum/forumdisplay.php?fid=7) +--- Thread: Building & cross compiling experience (/showthread.php?tid=117) |
RE: Building & cross compiling experience - Domarius - 07-11-2018 Question: The "Platformer.exe" that I built sucessfully in Linux, should it run just fine in Windows? I tried, and it crashed with a "DllNotFound". I tried putting the TileEngine.dll from the newly downloaded Win32 build in the same folder, but that didn't solve the problem. Here's the crash details; Code: Problem signature: I also tried "mono Platformer.exe" from the commandline, after installing Mono 32 bit for Windows and using its "Open Mono x86 Command Prompt" start menu entry, confirmed mono works from the commandline, but doing "mono Platformer.exe" as I did in Linux, didn't do anything in Windows. It just returned to the prompt immediately, no errors. Here's the evidence; Code: Mono version 5.12.0.226 Oh, btw, don't try getting MonoDevelop on Windows. There is no Windows download, you have to build it, it has errors, and even when you get it running, the "File -> Open" menu item does nothing! You can make new projects just fine, but opening existing ones? Noo. And no forum to ask for help in, only an IRC channel that no one replies on. So I guess I can only use MonoDevelop under Linux. So much for MonoDevelop being "cross-platform". RE: Building & cross compiling experience - megamarc - 07-11-2018 Regarding Ubuntu distros: Travis CI runs build tests under 14.04, so throw in another configuration... Do you know Travis? For building myself I use the 16.04 LTS branch and everything is ok. Debian Stretch (9.x) for Raspberry, and Mac OSX 10.11 "El Capitan" for Mac. And yes, there are teams maintaining cross platform libraries, with people experienced on the quirks of each platform. Windows has its dose of bad reputation, but the fact is that its compatibility and stability on the long run is much higher than Linux or OSX. Nowadays you can build apps in a Windows XP machine with Visual Studio 2005 and run that produced binaries under Windows 10. Try to do that with a 14-year old linux or OSX version... RE: Building & cross compiling experience - megamarc - 07-11-2018 MonoDevelop was acquired by Xamarin and turned into the commercial product Xamarin Studio, that in turn was acquired by Microsoft and integrated into the new VisualStudio 2017 as a plugin. That's why MonoDevelop is orphaned under Windows, because it would compete with their own commercial offerings. Yes, your C# Platformer.exe built in one machine should run in another. The problem here is not the Mono/.NET binary itself, but the fact that it relies on native system libraries: Tilengine and SDL2. Under linux that's easy because there's a common place where to put shared system libraries: /usr/lib everything you put there is accessible to everyone. Apt packages and the Tilengine install script put their binaries there. But in under Windows there's no such place to put common shared libraries and you have three options:
So in short, under Windows it's the end-user responsibility to make shared libraries widely accessible, or I must provide an installer. I don't know what should be my official solution for this matter. RE: Building & cross compiling experience - Domarius - 07-11-2018 Ah, I see - I didn't try SDL2.dll as well. I just experimented and from what I can tell, pretty sure the problem is I complied that example on 64bit Linux, so the 32 bit SDL2.dll I have is causing a "System.BadImageFormatException" error in Windows. I stopped experimenting because I have to pack it in for tonight, so I thought I'd run this by you for now;
RE: Building & cross compiling experience - megamarc - 07-11-2018 In .NET/Mono executables, you have to pair the version of the native shared library (SDL/Tilengine) with the architecture of the host OS that runs the program: If your OS is 32-bits, you must provide 32-bits dll/so, whereas in 64-bit OS, dll/so must be 64-bit. The architecture of the machine where you compile the .NET/Mono application is irrelevant, because they're platform agnostic. It's the architecture of the OS that loads and runs the executable the one that matters. Keeping this in mind, I've built C# Platformer.exe with .NET Framework 4.0 under 64-bit Windows and executed that same binary on the Raspberry Pi (that is 32-bit ARM) running mono. RE: Building & cross compiling experience - Domarius - 07-11-2018 Oh wow, ok. I still need to compile a 64 bit SDL2 then. Regarding your concerns distributing the DLLs, wouldn't you just provide 32bit and 64bit downloads as you have, and just let the developer know they need to release a 32 bit and 64 bit version of their game, with the appropriate DLLs included? RE: Building & cross compiling experience - Domarius - 07-12-2018 Forget I said compile - I can just download it, doh. Sometimes I have my head so far stuck in the details I forget the obvious things. Trying to get MonoDevelop working on Windows really did my head in. And that's sad, what you said about Microsoft buying out the Windows side of MonoDevelop. Just another thing they've bought up to extinguish the competition. A perfectly good free cross platform IDE for C# now doesn't have a working Windows version and you have to go back to MS Visual Studio. Anyway, I'm thrilled - the same file ran on Windows just fine, with the 64bit versions of Tilengine.dll and SDL2.dll. And then I found https://github.com/MonoGame/MonoKickstart, once all the files were in the folder and renamed appropriately, I have a folder of a game that runs on 64bit versions of Windows, Linux, and MacOS (apparently, can't test the latter) depending which file you run, so I could just distribute the one folder instead of providing separate downloads. Kickstart can switch to the 32bit versions of its files automatically, so I guess if I wanted to distribute a Windows 32bit version I could provide a separate download. This is new territory for me, have I got that right? Is there anything else I should be aware of? RE: Building & cross compiling experience - megamarc - 07-13-2018 Visual Studio is an outsanding tool, I'm not affiliated to Microsoft but I'm using this tool for many years. Recent Community versions are free for personal use and include the complete Xamarin plugin, unlike the former Express versions that were heavily stripped-down.. So in some way Microsoft has returned it to the open community. The problem is not C#/Mono, but the lack of a standard way in Windows to put common shared libraries. You can manage to have C# working with its correct set of libraries, but then you'll be in trouble again with Python, and with any native .exe you produce. That's a inherent problem in Windows to solve runtime dependences, other than providing an installer RE: Building & cross compiling experience - Domarius - 07-13-2018 Oh don't get me wrong, VS is great. It's just that they clearly couldn't stand another piece of software using C# that they didn't have control over... it would have been nice to just open the project in MonoDevelop on both Windows or Linux. Not a huge issue, just a shame I think. RE: Building & cross compiling experience - Domarius - 07-14-2018 Quick question - what is YOUR preferred workflow for building a Tilengine game? Eg. which combination of Windows, Linux, SDL2, C, C#, Python, etc. etc. And if it's primarily Windows, what workflow would you use for Linux? |