2

I need to make an application which is going to portable (windows, linux and Mac). This is the front-end, the GUI stuff. The back-end is written in C++. But now I'm exploring the options to build this front-end. The requirements is: 1) portability across the OS mentioned and, 2) a GUI builder 3) free software, to use and distribute the compiled binaries and related libraries. Aside C#+Mono, Qt and Lazarus pascal, what are some other options available?

3
  • 1
    I don't know a single IDE that supports every GUI framework so I think you need to specify the framework to use. For a free, portable & unrestrictive licenced C++ GUI take a look at wxWidgets wxwidgets.org (there are also bindings for other languages e.g. wxPython) – Steve Barnes Jun 17 '20 at 5:28
  • This is a local desktop app, not a web app? – Basil Bourque Jun 17 '20 at 6:06
  • By "portable" do you mean source compatible (ie compile the very same source for all platforms) or binary compatible (ie use the same unchanged binaries on each OS)? – Alejandro Jun 17 '20 at 15:11
2

I have not used this particular combination of tools for your particular purpose, but I will mention this possibility without exactly recommending it…


JavaFX

logo for JavaFX

JavaFX is a popular GUI toolkit for the Java platform. This framework was originally developed at Sun, acquired by Oracle, and recently open-sourced as OpenJFX (a subproject at OpenJDK). Development is now led by the Gluon company. JavaFX is the official successor to the Swing framework.

You can add download the JavaFX framework, and manually add to your project. Or you can use a dependency/build tool such as Maven or Gradle to automatically download the OpenJFX libraries into your project. Thirdly, you may choose to use a JVM that comes bundled with the OpenJFX such as LibericaFX by BellSoft or ZuluFX by Azul Systems.

Cross-platform

Being Java-based, your JavaFX app can run across many platforms including macOS, Linux, and Windows.

You can package your compiled code with a bundled JVM to make a standalone double-clickable app for each of the three platforms. A cutting-edge alternative is making a native app via ahead-of-time compilation using GraalVM.

Visual editor

As for a visual GUI editor, JavaFX Scene Builder is a visual editor developed as part of the OpenJFX project.

JavaFX Scene Builder can be used with multiple IDEs including with IntelliJ and with NetBeans.

Be aware that you have two alternatives to using a visual tool: Writing the interface declaratively via FXML, and writing the interface procedurally using Java code. I prefer the last one, having been surprised how well it works to simply make calls in Java to define a layout and add widgets.

Interoperating with C++ code

You can call C++ code from Java.

  • JNI is the classic vehicle.
  • JNA was later developed to be an easier route.

Cost

All the mentioned products are available free-of-cost.


Xojo

Xojo logo

An entirely different solution would be Xojo. Xojo is a commercial product that includes:

  • a modern object-oriented programming language
  • native compilers for multiple platforms including macOS, Linux, and Windows
  • a visual GUI editor

This might meet your needs, though it does come with a fee, and I do not know the specifics of calling your C++ backend code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.