Page 1 of 1

Best Cross Platform Build Approach?

Posted: Tue Nov 10, 2015 9:32 pm
by MJ9797
I'm new to cross platform development so I'm unsure how to go about developing simultaneously for Windows and Linux.

I was thinking of having Linux Mint running in a virtual machine and having the code in a shared directory that's available to the virtual machine. I was then going to build the Windows version of the application in Code::Blocks on the physical Windows machine, and have another installation of Code::Blocks on the virtual machine for building the Linux version. However, that seems a bit messy and I'm sure there must be a better way.

Apologies for my ignorance, but could somebody tell me the best way to go about developing for Windows and Linux simultaneously?

Re: Best Cross Platform Build Approach?

Posted: Wed Nov 11, 2015 4:32 am
by tierra
If you only have one computer, consider setting it up to dual-boot both Windows and Linux, and just use your VCS (i.e. git) to sync up your code. You'll want the extra CPU power necessary for compiling the code that you lose while compiling code inside of a virtual machine.

Re: Best Cross Platform Build Approach?

Posted: Wed Nov 11, 2015 8:48 am
by Laurent Berger
and use cmake.

Re: Best Cross Platform Build Approach?

Posted: Wed Nov 11, 2015 7:07 pm
by MJ9797
Thanks a lot for the replies. Dual booting would be a bit of a hassle and my Linux desktop only has a low power Atom processor so would probably be very slow for compilation. I'll give it a try in a virtual machine and see how slow compilation is.

I'm not familiar with cmake but I'll have a read about it now.

Thanks again for the advice.

Re: Best Cross Platform Build Approach?

Posted: Thu Nov 12, 2015 2:36 pm
by tierra
Atom CPU and virtualization? Ouch. Don't even bother with a virtual machine, your only option is to just dual boot. Using something like VirtualBox on an Atom CPU could easily take half a day just to compile wxWidgets. Even using VirtualBox / VMWare / or some other kind of virtual machine other than maybe KVM for development on a wxWidgets application is usually only a reasonable option for someone with at least a quad-core 2Ghz+ CPU with hardware virtualization support. Unless you have one of the newest Avoton Atom CPUs (which is highly unlikely), you're running a max of two cores at a max of 2Ghz at low power without hardware virtualization support (Intel VT-x). You should really just consider getting a new computer.

Re: Best Cross Platform Build Approach?

Posted: Thu Nov 12, 2015 9:19 pm
by mycae-wx
I use cross-compilation using the x86-mingw packages. I have a rather nasty bash script that pulls in all my dependencies and cross-compiles them. This has the advantage that upstream debian/mint/ubuntu maintainers patch most things that need patching. The downside is there are some hard-to-debug issues with cross-compilation.

That said, I’ve found the automatability, and auto-updates (simply apt-get the source again) to be a better solution than using tdm-gcc. The source for my compilation is available (https://sourceforge.net/p/threedepict/c ... ian-cross/ ), but there be dragons. Switching between 32 and 64 is usually quite simple.