Error when compiling on linux with glfw

I hope this is the right place to report this, since I couldn’t find where to report issues.

I tried to compile a project on my Fedora Linux distribution after installing all the dependencies. I ran into an error with glfw. When doing some digging, I noticed that glfw recently released a new version glfw3 and stopped supporting the old. glfw3 has some major differences with the previous version, most obvious that they changed the name of glfw.h to glfw3.h. But also a lot of changes with the inner framework. In short the current cocos2d it is not compatible with the new glfw3.

They released I guide that could aid in the transition here: http://www.glfw.org/docs/3.0/moving.html

I hope you can fix this quickly, best regards Matthijs

Thanks for sharing. Unfortunately the most changes are just function renaming, and glfw 3 still is not added to next ubuntu release, 13.10. Btw, which Fedora version you are using and which libraries except glfw3 it have? Does it have glfw2, sdl2?

Fedora 18. It does have sdl2. But ont glfw2 so that’s the problem I have now, I can’t go back to the old. I did try to install the glfw legacy version manually, downloading the source from github, but I still got undefined reference errors to functions of glfw.

You can link library with libglfw2, [1] says that you can just edit cocos2dx.mk: find string
SHAREDLIBS += -lglfw -lGLEW -lfontconfig -lpthread -lGL
and replace with
SHAREDLIBS += -Wl,-soname,libglfw.so.2 -lGLEW -lfontconfig -lpthread -lGL

About moving to next version: renaming API calls without changes is bad practice, so I suggest make optional SDL2 backend in addition to glfw2.

[1] http://stackoverflow.com/questions/171676/linking-against-a-specific-shared-library-version-in-linux

But I don’t have libglfw2 installed, as this error fatal error: GL/glfw.h: No such file or directory shows that there is no glfw.h. while when looking in my GL folder, there is an glfw3.h because I do have that version installed. Neither is there a libglfw.so.2 in my lib folder. Only a libglfw.so.3.0, a libglfw.so.3 and libglfw.so.

I can’t install libglfw2 since only 3 is available.

I fixed it, I believe. I manually built the glfw2 library from here: https://github.com/glfw/glfw-legacy using the make x11-dist-install command.
After that I renamed the created libglfw.so, which was placed in /usr/local/lib, to libglfw.so.2.7.9 and I had to move it to my /usr/lib64 directory. Then I created a link from libglfw.so.2 to libglfw.so.2.7.9.

still changing the code in cocos2dx.mk didn’t make a diffrence, so I did it badly and changed the libglfw.so link to point to libglfw.so.2.7.9 instead of libglfw.so.3.0

But as you said, this is bad practice, so maybe there is something wrong in the code change that you profided.

For all folks looking for solution to this:
http://voidfuture.com/2013/10/08/building-cocos2d-x-on-rhel-fedora-centos-linux/