I am a newbie trying to build a C++ project on Ubuntu 18.04, which I used to be able to build without any issues before updating from Ubuntu 16.04. My machine has an NVIDIA GPU running with NVIDIA driver 440.31.

Now, after my OS update, make gives me the following error:

/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libGL.so: undefined reference to `_glapi_tls_Current'

How do I solve this problem?

What I've tried: I've followed part of the answer on https://www.linuxquestions.org/questions/linux-software-2/undefined-reference-to-%60_glapi_tls_dispatch%27-how-can-i-solve-this-error-4175458263/

  1. First, readlink -f "/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libGL.so"
  2. That gave me /usr/lib/x86_64-linux-gnu/libGL.so.1.0.0 so I checked it using ldd
  3. libglapi.so.* was not listed in the result, but I don't know how to fix that.

1 Answer 1


Try this out: -D WITH_OPENGL=OFF

The error might be caused while building with OPENGL. so, if you don't need opengl support, please turn it off to see if the error goes away.

  • 2
    Care to explain what this does in the answer? Feb 22, 2021 at 8:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .