cocos2d / cocos2d-x

Cocos2d-x is a suite of open-source, cross-platform, game-development tools utilized by millions of developers across the globe. Its core has evolved to serve as the foundation for Cocos Creator 1.x & 2.x.
https://www.cocos.com/en/cocos2d-x
18.24k stars 7.06k forks source link

Cocos2d-x 2.2.6 Linux Build Issue #20671

Open MagneticPrism opened 3 years ago

MagneticPrism commented 3 years ago

I am getting these issues when i run build.sh for Linux. I know i have to link against glfw but i cannot find anything at all that's useful in any way/

LINK bin/release/OrbitSimulator /usr/bin/ld: ../../../lib/linux/release/libcocos2d.so: undefined reference to glfwSetMousePosCallback' /usr/bin/ld: ../../../lib/linux/release/libcocos2d.so: undefined reference toglfwSetKeyCallback' /usr/bin/ld: ../../../lib/linux/release/libcocos2d.so: undefined reference to glfwGetProcAddress' /usr/bin/ld: ../../../lib/linux/release/libcocos2d.so: undefined reference toglfwSetCharCallback' /usr/bin/ld: ../../../lib/linux/release/libcocos2d.so: undefined reference to glfwOpenWindowHint' /usr/bin/ld: ../../../lib/linux/release/libcocos2d.so: undefined reference toglfwGetMouseButton' /usr/bin/ld: ../../../lib/linux/release/libcocos2d.so: undefined reference to glfwTerminate' /usr/bin/ld: ../../../lib/linux/release/libcocos2d.so: undefined reference toglfwSetWindowCloseCallback' /usr/bin/ld: ../../../lib/linux/release/libcocos2d.so: undefined reference to glfwInit' /usr/bin/ld: ../../../lib/linux/release/libcocos2d.so: undefined reference toglfwSetWindowSize' /usr/bin/ld: ../../../lib/linux/release/libcocos2d.so: undefined reference to glfwSwapBuffers' /usr/bin/ld: ../../../lib/linux/release/libcocos2d.so: undefined reference toglfwOpenWindow' /usr/bin/ld: ../../../lib/linux/release/libcocos2d.so: undefined reference to glfwExtensionSupported' /usr/bin/ld: ../../../lib/linux/release/libcocos2d.so: undefined reference toglfwSetMouseButtonCallback' /usr/bin/ld: ../../../lib/linux/release/libcocos2d.so: undefined reference to glfwGetMousePos' /usr/bin/ld: ../../../lib/linux/release/libcocos2d.so: undefined reference toglfwSetWindowTitle' collect2: error: ld returned 1 exit status make: *** [Makefile:17: bin/release/OrbitSimulator] Error 1

slackmoehrle commented 3 years ago

Can you share more about your setup?

What distro?

What version of gcc?

What version of cocos2d-x?

Where did you get the version (download the .zip or clone from GitHub)?

Did you use the docs to install the deps, etc?

MagneticPrism commented 3 years ago

I am using Pop!_OS which is a debian/ubuntu distro but, I am using GCC v10.2.0, Cocos2d-x v2.2.6, if you're talking about where I got Cocos2d-x, I got it from https://cocos2d-x.org/cocos2dx, and I used the .sh file to install the dependencies. The issue is with GLFW and the version Cocos2d-x uses. Cocos2d-x 2.2.6 uses GLFW v2. I tried downloading and compiling the glfw-legacy repo from the GLFW github. It's a linking issue but, when I install GLFW 2 from the github repo, it doesn't really fix my issue.