Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Developing Windows applications on Linux? [closed]

My primary OS is Linux, but now I'm forced to write some C++ applications for Windows. I was thinking about developing on the Linux box with cross platform libraries like WxWidgets (and some care about other platform dependencies) and then cross compiling the result to mingw target.

So the tools I'm thinking of using are

  • g++ for compilation and cross-compilation.
  • CMake
  • WxWidgets
  • ??? for making windows installer packages
  • wine for testing of the windows version

And my questions:

  1. What are some free (or even better open source) installers for Windows that I might use to create the final package? It would help if the package could be prepared from Linux.

  2. Will Wine be enough to test the cross compiled version (after all the logic is tested in the Linux version)?

  3. Is this a good idea? :-)

like image 711
cube Avatar asked Aug 06 '09 09:08

cube


People also ask

Can I develop Windows apps on Linux?

Windows applications run on Linux through the use of third-party software. This capability does not exist inherently in the Linux kernel or operating system. The simplest and most prevalent software used for running Windows applications on Linux is a program called Wine.

What does wine do for Linux?

Wine is an application that allows you to run Windows programs on a Linux system. Wine is similar to an emulator, but with a different technology that improves performance.

Can Wine run any Windows program?

What is Wine? Wine (originally an acronym for "Wine Is Not an Emulator") is a compatibility layer capable of running Windows applications on several POSIX-compliant operating systems, such as Linux, macOS, & BSD.


6 Answers

Check Qt too. It's a very rich cross-platform framework.

As for installers I'd highly recommend WiX.

For testing it will be much better to use some kind of virtualization like Sun Microsystems's VirtualBox. I believe you could use a trial version of Windows or Windows 7 RC, which is free to use until March 2010.

like image 61
Ray Avatar answered Nov 07 '22 16:11

Ray


First of all, yes it is good idea. I have several projects that I maintain their Windows version in this way.

In any case, I suggest you test the final product on Windows machine. If you have a license for Windows OS, you may use virtualization to do final tests.

I suggest to use Autotools that has very good cross compilation support and works "natively" with a cross compiler.

Under Debian for example running

./configure --host=i586-mingw32msvc

This would create the correct cross compilation makefile as if this was Unix project.

In any case, I would recommend to develop a cross platform version and time-to-time test native Windows version with Wine/Windows by cross compiling them.

like image 31
Artyom Avatar answered Nov 07 '22 18:11

Artyom


You imply that the applications are for Windows only and not cross-platform, in which case I think the answer to 3. - This is really not a good idea - trumps the rest.

The reason being you are going to have to extensively test the application under Windows anyway, either directly or in a virtual instance. That being so you're better to develop under the target OS because you're more likely to produce a better application - both from catching the bugs earlier and more thoroughly and ensuring your application 'works' for your users. I certainly wouldn't trust just Wine.

I'm not a big fan of cross-platform widgets. Like Java applications you generally end up with something that doesn't quite look right, and like the uncanny gap that can be enough to make your application smell bad to a large section of your users. Even at the slightly more abstract level, each OS's applications have a slightly different feel as to how they work and you'll most likely end up with a Windows application that feels like a, say, KDE one, which will again put your users off.

So yes, certainly possible to do this, but probably not the optimal approach from point of view of the quality of the end product. To do so will give yourself something of a handicap with what you produce and I'd say that's likely to offset the convenience to you of using a Linux platform. Actually I'd be surprised if you manage even that because I'd bet you'll spend more time messing around with the widgets trying to fine-tune them so they work right under real Windows than you'll gain from using an unfamiliar Windows toolset.

like image 39
Cruachan Avatar answered Nov 07 '22 18:11

Cruachan


    • InstallJammer allows you to create installers for *nix and Windows. I am not sure if it allows cross creation of installers (i.e. creating Windows installers from *nix). A commercial option with demo available to try is the Bitrock InstallBuilder.
    • Maybe... If you have a Windows license, Dav's suggestion would be better.
    • If it helps you work better/more efficiently & effectively, sure.

Keep us posted on how you get on - this is interesting.

like image 26
John Barrett Avatar answered Nov 07 '22 18:11

John Barrett


2) No, Wine as it says is not Windows, you can not reliably test it like that. I suggest running a Virtual machine in your Linux, that will make your work much smoother.

3) It sounds possible, for the graphical aspect I would also consider GTK+ which was used for GIMP, and works much the same on Windows and Linux.

like image 30
Liran Orevi Avatar answered Nov 07 '22 16:11

Liran Orevi


You will need an MSDN licence anyway to get access to all the multitude of versions of Windows you'll want to test on.

You'll want to install the test OSs on VMs. This could be on your Linux desktop, but a dedicated box might be better.

I don't know how many versions of Windows you plan on supporting, but you should definitely test on all of them. Wine is not Windows, nor is Windows XP the same as Windows Vista, Windows 7, etc. There are also a lot of different distributions and languages of Windows, some of which you should undoubtedly test on.

By all means, develop on Linux. By all means, use cross-platform widgets (yes, these are good). But you'll still need your MSDN licence so you can install test OSes.

like image 41
MarkR Avatar answered Nov 07 '22 17:11

MarkR