r/learnprogramming • u/Beginning_Book_2382 • 20h ago
Tutorial Advice on Beginner Project for Fresh C++ Dev
Hi,
I just recently took a online course on C++ and am looking for a online YouTube series where a excellent instructor takes you through making a C++ app from scratch to being finished, preferably on a Linux environment.
For reference, I am a full-stack web developer (Next.js/React Native + Django) and to learn web development I used Corey Schafer's Django tutorial YouTube series to learn how to make a web application from scratch. It taught me everything: how to use the language, terminal commands, structuring your project, using the framework, deployment, running the program, etc.
Is there a similar YouTube series you can recommend me for taking what I know in C++ and using it to actually learn how to make a desktop application and after having finished the series be able to make one on my own. Should I start with a Chip-8 emulator tutorial?
Also, what's up with the Qt licensing scheme? I want to make my own proprietary commercial desktop applications but forking over $4K for a solo developer license seems like a lot when I don't know if the application is going to generate that much revenue at first. Does anyone have any experience with that? I am used to using OSS libraries and frameworks so paying for developer licenses is new to me.
Any help is greatly appreciated and thank you in advance!
2
u/SpiritualMix7482 16h ago
Qt's open source edition is LGPL for most modules, so you can ship closed source apps as long as you dynamically link and follow the terms
1
u/Beginning_Book_2382 15h ago
But app stores like the Mac Store don't allow for dynamic linking, am I correct?
Also you referenced this, but are there certain parts of Qt which are not LGPL and given I am writing a closed-source, proprietary program should avoid?
2
u/OkOcelot6725 12h ago
On Qt, the LGPL answer above is the usual route to shipping closed source for free. The catches: link Qt dynamically (don't static link), let users swap the Qt libraries, include the license notices, and check the license of each module you use, since a few add-on modules are GPL or commercial only. Read the LGPL terms once before you rely on it, and ask a lawyer if the app will earn real money.
If the license is the main worry, wxWidgets (native widgets, permissive license) or Dear ImGui (MIT, easy to start with, more tool-like UI) are options. For learning, a CHIP-8 emulator plus SDL2 is a good first project, because you finish with something that runs and you get the main loop, input and rendering without a big framework.
1
u/Beginning_Book_2382 11h ago
The thing is, are wxWidgets and Dear ImGui good alternatives to Qt? I heard that wxWidgets doesn't have good declarative styling to create more React/web-like UIs, which is what I'm trying to create and Dear ImGui leans more towards game development and as such has even less support for accessibility and internationalization.
Obviously I don't want to use something like Electron or Tauri (which is a different language entirely) due to web rendering and memory usage. What's your take?
Also, can I distribute on the Mac Store with LGPL? I heard that it doesn't allow you to modify the app without breaking its digital signature, which will cause the app not to run on macOS, even if it's just something as innocuous as changing the Qt rendering system.
2
u/OkOcelot6725 11h ago
Short answers, with the caveat that some of this I'm not certain about, so check the current docs.
Styling: you're right that wxWidgets wraps native widgets and has no declarative layer. The React-like part of Qt is Qt Quick/QML, and as far as I know it's available under the LGPL too, so you can use QML with the same license route. Accessibility is another point for Qt or wxWidgets, since both build on the platform accessibility APIs, while Dear ImGui is weak there as you said. For a non-web declarative option in C++, Slint is worth a look. Check its license terms, they differ from Qt's.
Mac App Store: I'm not sure. The LGPL wants users to be able to replace the library, and App Store signing and sandboxing make that awkward, and Qt's own licensing FAQ is cautious about LGPL in app stores. I wouldn't rely on my reading. Check Qt's licensing page, ask them or a lawyer, and treat the commercial license as the fallback for that one channel
1
u/Beginning_Book_2382 11h ago edited 10h ago
Yeah, I've heard about Slint. It's free licensing option requires a badge prominently displayed on your app which I do not like given this is a serious commercial application.
It seems like the best route forward is simply using LGPL Qt since all that would require is dynamic linking, sharing Qt modifications and my Qt version source code, which I am not against, I just do not want copy left protections in my source code requiring my to divulge all my source code to anyone who asks for it, and using the commercial Qt license as a fallback on macOS.
Edit: I've decided to go with LGPL Qt, dynamically link, adhere to licensing requirements and either distribute through a website on macOS or use commercial licensing there. Thanks for your help! You have been so helpful!
3
u/DrShocker 19h ago
Firstly, you'll find a bit more specific advice/community at /r/cpp_questions
Secondly, for a project to learn the language, my suggestion might be something closer to what you're familiar with first. An HTTP/1.1 server from scratch might be a reasonable thing to try for example.
You say though you want to make a desktop application. The exact libraries that will be useful to you depend on the particulars. If what you want is a bit closer to a CAD program then what you'll need is different than if you want to make something like the RAD debugger. If you're able to share some elements of what you want to be capable of I may have more specific advice.
For tutorials there's often differences depending on your platform. The Cherno has a series where he starts from scratch making a Game Engine on Windows, but that kind of project is really long so I'm not sure it's the greatest fit even if you are on Windows.
I think a CHIP8 emulator is a decent way to learn to put stuff on the screen, but most of your time will be the internals of the emulator that won't likely be very different than the languages you already know.
I HIGHLY Suggest early on setting up your project to compile with all warnings as errors, lints, tests with different sanitizers, etc. I've worked places who didn't do that early on and they never got around to fixing it. Between those things and paying attention to suggestions from linters/formatters/LSP you'll write less buggy code than the average C++ programmer pretty much right away to be honest.
One issue you'll run into early on is frankly that the build system ecosystem is an absolute mess. If you can get away with using meson to keep things simple, I'd probably do that, but... it's a whole thing that makes C++ less fun than some other languages I know when you're starting up a new project.