[INFO] Installing VirtualBox may break your building toolchain (on 22.04)

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

[INFO] Installing VirtualBox may break your building toolchain (on 22.04)

Post by openBrain »

Just for the record in case it happens to someone else.

On my Kubuntu 22.04 (but I guess other distros may be concerned), I installed VirtualBox (packaged from official distro) and doing this all of a sudden broke my building toolchain.
When trying to compile, I get error messages saying that it cannot find all kind of standard libs like '<string>' or '<iostream>'.

Reconfiguring Cmake failed with error message saying '/usr/bin/ld: cannot find -lstdc++'.

I had some hard time figuring out what was going wrong, but it happened that VirtualBox needed gcc-12 for some dkms support so it installed it as a dependency.
I originally had gcc-11 and g++-11 installed. The problem was that VirtualBox installed only gcc-12 but not g++-12.
Don't ask me why, but such configuration prevents compiler to find the standard C++ library.

So if you see such errors, ensure your highest gcc and g++ versions are same.
After manually installing g++-12, everything was back working.

BTW, I use Clang to compile, not GCC, so it's not linked to actually "using" gcc/g++ to build FreeCAD (however as you can see I use the std lib from GNU).

Help was found here : https://stackoverflow.com/a/74832544/20527947 :)
Post Reply