When i want build my app for linux i have such linking error:
/usr/bin/ld: /home/.../linux/debug/libcocos2d.so: undefined reference to symbol 'glEnable'
/usr/bin/ld: note: 'glEnable' is defined in DSO /usr/lib/gcc/i686-linux-gnu/4.6/../../../i386-linux-gnu/libGL.so so try adding it to the linker command line
But when i remove -lGL i don’t have any linking error and everything works fine i test it on 2 computers.
I have the same issue.
i got this fixed when I remove “-lGL” in cocos2dx/proj.linux/cocos2dx.mk.
this rule works fine with all the examples.
I’m using ubuntu 12.04 64bit.
I’m wondering why all the examples didn’t have this linking error excepts my project. My makefile was just copied and modified based on HelloCpp’s!
I am having a similar linkage error, but have not been able to resolve it
/usr/bin/ld: cocos2d-x-v3.0-pre-alpha0/lib/linux/debug/libextension.a(CCSkeleton.o): undefined reference to symbol 'glLineWidth'
/usr/bin/ld: note: 'glLineWidth' is defined in DSO /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libGL.so so try adding it to the linker command line
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libGL.so: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
I am not sure how to link this, this is what I have
mike@mike-laptop:/usr/lib/x86_64-linux-gnu/mesa
$ ls -l
total 376
-rw-r--r-- 1 root root 31 Jun 18 15:58 ld.so.conf
lrwxrwxrwx 1 root root 14 Jun 18 15:58 libGL.so -> libGL.so.1.2.0
lrwxrwxrwx 1 root root 14 Jun 18 15:58 libGL.so.1 -> libGL.so.1.2.0
-rw-r--r-- 1 root root 380808 Jun 18 15:58 libGL.so.1.2.0
Ok, now I’ve seemed to have messed something up that was working.
On a separate cocos2d-x project that wasnt including the Spine extension that was causing my error above, I can build but not run the app anymore (it was previously able to run)…
libGL error: failed to load driver: swrast
libGL error: Try again with LIBGL_DEBUG=verbose for more details.
cocos2d-x debug info [SDL Error: Unknown touch device, line: 90]
cocos2d-x debug info [Not totally ready :(]
cocos2d-x debug info [OpenGL 2.0 not supported]
cocos2d-x debug info [Assert failed: fail to init OpenGL extension ARB_vertex_buffer_object]
MyApp: ../platform/linux/CCEGLView.cpp:106: virtual void cocos2d::EGLView::setFrameSize(float, float): Assertion `0' failed.
I had made a symlink at /usr/lib/x86_64-linux-gnu/libGL.so.1 -> /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 attempting to fix my first issue, which it didn’t, so then I removed it, and now my system just crashes to a black screen and reboots my user account when I try to run my above app.