Perlmint / glew-cmake

GLEW(https://github.com/nigels-com/glew, source updated nightly) with Cmake and pre-generated sources

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Undefined Reference Error while building using CMake

shivakanthsujit opened this issue · comments

I was following the instructions on how to build using cmake and got the following error

lib/libGLEW.so.2.2.0: error: undefined reference to 'glXGetProcAddressARB'

lib/libGLEW.so.2.2.0: error: undefined reference to 'glXGetClientString'

lib/libGLEW.so.2.2.0: error: undefined reference to 'glXQueryVersion'

CMakeFiles/visualinfo.dir/bin/glew-cmake/src/visualinfo.c.o:visualinfo.c:function CreateContext: error: undefined reference to 'glXQueryExtension'

CMakeFiles/visualinfo.dir/bin/glew-cmake/src/visualinfo.c.o:visualinfo.c:function CreateContext: error: undefined reference to 'glXChooseVisual'

CMakeFiles/visualinfo.dir/bin/glew-cmake/src/visualinfo.c.o:visualinfo.c:function CreateContext: error: undefined reference to 'glXCreateContext'

CMakeFiles/visualinfo.dir/bin/glew-cmake/src/visualinfo.c.o:visualinfo.c:function CreateContext: error: undefined reference to 'glXMakeCurrent'

CMakeFiles/visualinfo.dir/bin/glew-cmake/src/visualinfo.c.o:visualinfo.c:function DestroyContext: error: undefined reference to 'glXDestroyContext'

CMakeFiles/visualinfo.dir/bin/glew-cmake/src/visualinfo.c.o:visualinfo.c:function main: error: undefined reference to 'glXQueryExtensionsString'

collect2: error: ld returned 1 exit status

make[2]: *** [CMakeFiles/visualinfo.dir/build.make:94: bin/visualinfo] Error 1

make[1]: *** [CMakeFiles/Makefile2:110: CMakeFiles/visualinfo.dir/all] Error 2

make[1]: *** Waiting for unfinished jobs....

lib/libGLEW.so.2.2.0: error: undefined reference to 'glXGetProcAddressARB'

lib/libGLEW.so.2.2.0: error: undefined reference to 'glXGetClientString'

lib/libGLEW.so.2.2.0: error: undefined reference to 'glXQueryVersion'

CMakeFiles/glewinfo.dir/bin/glew-cmake/src/glewinfo.c.o:glewinfo.c:function glewCreateContext: error: undefined reference to 'glXQueryExtension'

CMakeFiles/glewinfo.dir/bin/glew-cmake/src/glewinfo.c.o:glewinfo.c:function glewCreateContext: error: undefined reference to 'glXCreateContext'

CMakeFiles/glewinfo.dir/bin/glew-cmake/src/glewinfo.c.o:glewinfo.c:function glewCreateContext: error: undefined reference to 'glXMakeCurrent'

CMakeFiles/glewinfo.dir/bin/glew-cmake/src/glewinfo.c.o:glewinfo.c:function glewCreateContext: error: undefined reference to 'glXMakeCurrent'

CMakeFiles/glewinfo.dir/bin/glew-cmake/src/glewinfo.c.o:glewinfo.c:function glewCreateContext: error: undefined reference to 'glXDestroyContext'

CMakeFiles/glewinfo.dir/bin/glew-cmake/src/glewinfo.c.o:glewinfo.c:function glewCreateContext: error: undefined reference to 'glXChooseVisual'

CMakeFiles/glewinfo.dir/bin/glew-cmake/src/glewinfo.c.o:glewinfo.c:function glewDestroyContext: error: undefined reference to 'glXDestroyContext'

collect2: error: ld returned 1 exit status

make[2]: *** [CMakeFiles/glewinfo.dir/build.make:94: bin/glewinfo] Error 1

make[1]: *** [CMakeFiles/Makefile2:137: CMakeFiles/glewinfo.dir/all] Error 2

Can you give me some more details? version of cmake, OS, compiler

commented

This happens with me as well
CMake Version: 3.21.1
OS: 5.13.8-1-MANJARO
Compiler: Ninja (Not sure if it uses clang or gcc by default, I have both)

@CyberDie22

I tried to reproduce on arch Linux docker container - I couldn't find proper manjaro docker & failed to boot manjaro with VM, But I successfully built this. I just installed these packages - gcc, ninja, cmake, libglvnd(1.3.3.1).

It looks like no glx on your system. But currently, glew-cmake does not support mode without glx.

If my assumption is right, Would you mind test fix/glx branch with -DGLEW_OSMESA=YES option on your system?

No response from author & other user