Best Cross Platform Build Approach?

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
MJ9797
In need of some credit
In need of some credit
Posts: 2
Joined: Tue Nov 10, 2015 9:25 pm

Best Cross Platform Build Approach?

Post 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?
User avatar
tierra
Site Admin
Site Admin
Posts: 1355
Joined: Sun Aug 29, 2004 7:14 pm
Location: Salt Lake City, Utah, USA
Contact:

Re: Best Cross Platform Build Approach?

Post 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.
Laurent Berger
Earned some good credits
Earned some good credits
Posts: 138
Joined: Tue May 20, 2008 1:03 pm

Re: Best Cross Platform Build Approach?

Post by Laurent Berger »

and use cmake.
L.B.
MJ9797
In need of some credit
In need of some credit
Posts: 2
Joined: Tue Nov 10, 2015 9:25 pm

Re: Best Cross Platform Build Approach?

Post 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.
User avatar
tierra
Site Admin
Site Admin
Posts: 1355
Joined: Sun Aug 29, 2004 7:14 pm
Location: Salt Lake City, Utah, USA
Contact:

Re: Best Cross Platform Build Approach?

Post 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.
mycae-wx
In need of some credit
In need of some credit
Posts: 3
Joined: Thu Nov 12, 2015 8:47 pm

Re: Best Cross Platform Build Approach?

Post 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.
Post Reply