Frage

I've been doing a variety of C++ projects--several in Qt--and while I'm always using libraries that should be cross-platform (Qt, OpenGL, etc.) I don't know of any tools for building one codebase on a variety of platforms as exist for the mobile. Do such services exist where I can have a basic build framework, do my development around it, and send it to some service that builds it for windows, mac and a couple linux distros?

War es hilfreich?

Lösung

Hopefully my ramblings make sense and aren't just crazy talk. :)

I think because many libraries rely on OS specific threading, there are very strong limitations in place.

Most projects that use some third-party libraries, and unless all those libraries are specifically cross-platform, the project is no longer an easy build for cross platform.

The closest thing would be if you said, "if you link exclusively to the standard libraries and/or Boost and/or Qt and/or <insert name of cross platform library>, then packaging it for all desktop platforms as a service would be do-able.

A number of the scripting languages strive to get to this point, of having most of their modules and builds behave identically cross platform. But I still occasionally find an open source project based in a common scripting language that says "unix only" or "windows only". Typically I think it is because it is annoying to port the threading set up between the two... or someone in the project is a die-hard <insert name of OS> fan and thinks that anyone wanting to do something on a different OS is crazy. Only when the community behind a particular open source tool gets large enough and diverse enough in OS preference, does a change happen and it gets ported and maintained for multiple distributions.

KDE is in the beta phase of supporting all their apps on Windows.

wine gets people by for a number of window specific programs when running them on linux.

cygwin gets people by that want linux commands available on their windows machine.

I think some of the services that are in the ballpark of this notion, don't do C++, but instead are serving SaaS, Software as a Service. They setup a server to run your program and a website that serves it up to the browser, and then you have a cross platform program available. And then there is Java, that is kind of in that same direction...

Hope that helps.

Andere Tipps

I don't think there is such a thing that builds your C++ code for Windows, Mac and Linux. You can use cross-platform libraries like Qt which enables you to compile your code on various platforms including mobile. But to do that you should compile your code on the target platform or install the necessary tool-chains and cross compile your code. But all of the work including installing tool-chains and providing the appropriate settings should be done manually.

For instance you should use MinGW to compile for Windows on Linux or cygwin to compile for Linux on Windows which needs a bulk of work. Also It depends on your host platform on which you want to cross-compile for a target platform. For example if you want to cross-compile for Windows on Mac, the tool-chains ad settings is different from cross-compiling for Linux or Mac on Windows.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top