i'm quite new to programming. i'm a mechanical engineering grad student and i've been learning c++ for a year now on my own. so far i can program only win32 console programs i'll soon finish literature on OOP c++ like Robert Lafores interactive c++, C++ How To Program (Deitel) and Victor Shterns Core c++.
As I want to write portable GUI aplications for problem solving in mechanical engineering, what libraries or enviroments should i use? was i wrong to chose c++ for programming such applications, because i read that Java and Python have less portability problems (something about a built in interpreter and bit-code.. (?)) and that GUIS and similar are much easier to code in Java or Python. If i want to make commercial apps. the best way to go is OpenSource (less (licensing) is better :), and i want my programs to run both on windows and linux. It seems a waste of time to learn a GUI development library only for windows... or only for linux.. .

Dani AI

Generated

For : C++ is a fine choice for the numerical core — it gives control and speed — but portability comes from how you split the app and which libraries you pick, not from the language itself (as already pointed out). A robust, long-lived approach is to isolate the heavy math as a platform‑neutral C++ library with a small, well‑documented API, and keep the GUI layer separate so you can swap or rebind it later.

Three practical integration patterns to consider:

  • In‑process bindings: generate Python (or other) bindings to call the C++ core directly. Tools like pybind11 (https://pybind11.readthedocs.io/en/stable/) or SWIG (https://www.swig.org/) are common. Low overhead, close to native speed, but increases build complexity.
  • C ABI wrapper: expose a small C API and use ctypes/cffi from Python. Simpler compatibility across compilers and languages.
  • Out‑of‑process: run the core as a service/subprocess and use IPC (sockets, REST, JSON). Slower but gives clear separation, simpler hot‑restarts, and easier language-agnostic clients.

Build and distribution notes: use CMake (https://cmake.org/) for cross‑platform C++ builds. For Python GUIs or prototypes, bundle with PyInstaller (https://www.pyinstaller.org/). On Linux consider AppImage/Flatpak for single‑file distribution (https://appimage.org/); on Windows use native installers (NSIS/InnoSetup) or packaged executables.

Licensing and workflow: check third‑party licenses carefully — some GUI toolkits require GPL or offer commercial licenses (see Qt licensing as an example: https://doc.qt.io/qt-5/licensing.html). A practical path: build and test the C++ core first (CLI + unit tests), prototype GUI in a high‑level language for fast iteration, then bind or ship the final UI using the packaging strategy you chose. ’s toolkit list is a handy map for GUI options once the architecture is decided.

Recommended Answers

All 4 Replies

i am well aware of that. my problem is which one to choose, and should i use c++ libraries to make GUIs, or code the calculation-parts of the program in c++ (because it's faster and i can control memory usage) and develop the GUI in say, Python, because it's easier that way...

Python GUI programming is no more or less platform independent than C++ GUI programming. The only difference is the libraries used.

If you want to link between Python and C++, you might want to use the same GUI library in both bodies. You can use Tk (Tkinter in python), or wxWidgets, or FLTK, or GTK.

My personal observations are that people tend to like wxWidgets best, followed closely by FLTK.

See here for python GUI links.

You will generally find it no more difficult to program these in C++ than Python. Whatever you choose will require a bit of a learning curve.

Hope this helps.

this helps ALOT. i'm experiencing the steep slope of the learning curve for about 10 months 3-4 hours a day (that's a lot of time for me, because programming is not in my curriculum)... it seems that there is no end to it. still, there's a catch: its FUN. it suprised me how fun it is to play depeche mode and code in c++. THANX i'll find out as much as i can when the time comes about wxWidgets or smth. similar!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.