Linux build [error] undefined reference to GLIBC

Hi

I am trying to build the axe game from video #10 (popup Window) on Linux (Ubunut 20 64bit). I’ve istalled the raylib using Homebrew

image

I get this linking error when I include the ralib.h

make[1]: Entering directory '/home/yahya/Desktop/GameDev/vscode-template-main'
g++ -o axe_game *.cpp -Wall -std=c++14 -D_DEFAULT_SOURCE -Wno-missing-braces -g -O0 -Wl,-rpath,/home/linuxbrew/.linuxbrew/lib -I/home/linuxbrew/.linuxbrew/include -isystem. -isystem/home/yahya/Desktop/GameDev/src -isystem/home/yahya/Desktop/GameDev/release/include -isystem/home/yahya/Desktop/GameDev/src/external -L. -L/home/linuxbrew/.linuxbrew/lib -L/home/yahya/Desktop/GameDev/src -lraylib -lGL -lm -lpthread -ldl -lrt -lX11 -lc -DPLATFORM_DESKTOP
/usr/bin/ld: /home/linuxbrew/.linuxbrew/lib/libraylib.so: undefined reference to `pthread_attr_setstacksize@GLIBC_2.34'
/usr/bin/ld: /home/linuxbrew/.linuxbrew/lib/libraylib.so: undefined reference to `dlclose@GLIBC_2.34'
/usr/bin/ld: /home/linuxbrew/.linuxbrew/lib/libraylib.so: undefined reference to `dlsym@GLIBC_2.34'
/usr/bin/ld: /home/linuxbrew/.linuxbrew/lib/libraylib.so: undefined reference to `fstat@GLIBC_2.33'
/usr/bin/ld: /home/linuxbrew/.linuxbrew/lib/libraylib.so: undefined reference to `stat@GLIBC_2.33'
/usr/bin/ld: /home/linuxbrew/.linuxbrew/lib/libraylib.so: undefined reference to `pthread_key_delete@GLIBC_2.34'
/usr/bin/ld: /home/linuxbrew/.linuxbrew/lib/libraylib.so: undefined reference to `pthread_setspecific@GLIBC_2.34'
/usr/bin/ld: /home/linuxbrew/.linuxbrew/lib/libraylib.so: undefined reference to `pthread_create@GLIBC_2.34'
/usr/bin/ld: /home/linuxbrew/.linuxbrew/lib/libraylib.so: undefined reference to `pthread_join@GLIBC_2.34'
/usr/bin/ld: /home/linuxbrew/.linuxbrew/lib/libraylib.so: undefined reference to `pthread_getspecific@GLIBC_2.34'
/usr/bin/ld: /home/linuxbrew/.linuxbrew/lib/libraylib.so: undefined reference to `hypotf@GLIBC_2.35'

image

I have a right installation of other things as I can build the hello world example.

I am using the template attached in the course without modification.

image

It almost looks like it’s trying to look for an older version of glibc.

Since the homebrew package is pre-built of an unknown target spec, can you try uninstalling raylib using brew uninstall raylib and then setting up a dynamic shared library using this method?

Focus on the steps for GCC, Ubuntu, Make, and building/installing a Shared Library.

It is working now after building raylib as dynamic library. I can build the examples. Thanks.

Maybe it worth mentionening this problem in the setup guide for Linux.

I can definitely see it worth adding for those struggling with the Homebrew method.

Especially since installation documentation has matured quite a bit since we first launched the course.

I’ll make a note of it internally.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms