Trying to build Godot on linux. Linker error can't link to std library

Godot Version

4.2

Question

Hi,

I’m trying to build Godot 4.2 on my arm64 Linux machine. However, when trying to build, I get a linker error saying it can’t find the std library.

/usr/bin/ld: cannot find -lstdc++: No such file or directory
collect2: error: ld returned 1 exit status
scons: *** [bin/godot.linuxbsd.editor.arm64] Error 1
scons: building terminated because of errors.
[Time elapsed: 00:12:25.710]

I already made sure that i’ve got all the dependencies like the std library installed.

I am running Fedora 39 on an arm64. (Apple M1)

Thank you for your responses.

1 Like

did the export window show any warning or error before you export linux build?

No. There was no warning.

this one has similar error status for issues found here:

Hi,

While this is a similar issue, this does not work for me.

I’ve got the same error message on F39 x86_64.

[100%] /usr/bin/ld: cannot find -lstdc++: No such file or directory
collect2: error: ld returned 1 exit status
scons: *** [bin/godot.linuxbsd.editor.x86_64] Error 1

After following the instruction for Fedora on Compiling for Linux, *BSD — Godot Engine (latest) documentation in English I’ve found that libstdc++-static dependency was missing.

sudo dnf install libstdc++-static

That fixed the problem. I saw that headers for this lib were installed together with g++, so I assumed that compiled library is also installed, but it was not.

1 Like

FWIW, Fedora discourages the use of static libraries for general purposes, so the .a is quite often shoved into a separate package from -devel.

1 Like