solving a clang++ compiler problem on linux mint 22.1

During my initial setup of Linux Mint on the Samsung Series 7, I installed the Flutter toolkit ( ). Flutter has additional application requirements, one of which is Clang. So I installed all the additional requirements, then installed Visual Studio Code, then within VSCode I installed Flutter plugin.

Note that I did not install support for Android (Android SDK and Android Studio) nor the Web (via Chrome). All I’m doing is writing Flutter desktop applications.

The Flutter plugin within VSCode automates quite a lot. Using the VSCode Command Palette, you can create an initial Flutter application (Flutter: New Project) that will create skeleton code and build files that compiles and runs the graphical equivalent of hello, world.

Visual Studio Code with the Flutter plugin and an initial Flutter application, running that application in debug mode.

As you can see, the Flutter tools for both the framework and the VSCode plugin provide an effortless on-ramp to developing applications. Creating the start of an application is ridiculously easy, and it’s capable of building and executing from the get-go. One feature this has and I use quite a lot is hot reload. When I make changes to the code, when I save the changes they’re rebuilt and the running application restarted immediately showing those changes. That’s why I use this setup.

Sample Flutter application running on the desktop.

And here is the initial application’s extremely simple desktop window. When this works well, it’s a little like magic.

Unfortunately I ran into a problem where Clang, one of Flutter’s dependencies, could not link a C++ application that is part of the Flutter application. The error message reported by the Flutter tooling was (with much superfluous reporting snipped away):

/usr/bin/ld: cannot find -lstdc++: No such file or directory

This really annoyed me because I have this same setup on my other Linux Mint system, the UM250. With a bit of googling I discovered what was wrong, and how I’d accidentally side-stepped the issue on the UM250. I solved the problem on the Series 7 with sudo apt install libstdc++-12-dev. After that the Flutter tool chain just worked.

Why didn’t I see this issue on the UM250? Because I’d installed gcc/g++ version 12 to support another small project I was working on. On the UM250 I have both versions 11 and 12. Then when I later updated an older installation of Flutter and ran the same simple tests, everything worked there as well. I don’t intend to install gcc/g++ version 12 on the Series 7 as there is no need.

What I don’t understand is how Clang and GCC got out of sync on Linux Mint 22.1. The version of Clang installed is version 14, and requires libstdc++-12. Unfortunately Linux Mint 22.1 installs GCC version 11, which means that if you wanted to build with Clang you’re out of luck unless you know of Clang 14’s dependencies.

configuring visual studio code for qt 6 development on linux mint

Configuring Visual Studio Code’s include path for Qt 6 development

As I wrote earlier I’ve switched back to Visual Studio Code on my Linux Mint 21.1 system for C++ development. In order to support Qt 6 C++ development, I needed to modify the C++ plugin’s include path to point to specific Qt 6 include files. The easiest way to do this is (and this assumes you have the Microsoft C/C++ extension installed to begin with):

  1. Select Extensions in Visual Studio Code on the far left.
  2. On the C/C++ Extension left-click the gear.
  3. On the menu that appears, select Extension Settings.
  4. In the Settings screen that opens, scroll down to C_Cpp > Default: Include Path.
  5. Click the blue Add Item button.
  6. In the input text box that appears, type in the full path to the Qt include files. Note in my example I have two paths to the Qt 6 include files.

Once you’ve updated the include paths just close the Settings tab. If you don’t have those additional paths in the Microsoft C/C++ plugin, then any and all Qt include files will have the dreaded Red Squiggly Lines underlining all those include files it can’t find.