I've been trying to install Box2D via cmake -> make
Sorry that this is so long, AT THE END IS A TL;DR !!
EDIT about 3 months or so later, I solved it (i think) per accident | See after TL;DR
Heres what I did: First off, downloaded Box2D from the gitHub repository, unzipped and moved it to a convenient location, opened the Build directory via the terminal. Then used
cmake -DBOX2D_INSTALL=ON -DBOX2D_BUILD_SHARED=ON ..
, just like the Building.txt told me to, and it worked fine. Then wanted to
make
but got 87% through an Error in the internal.h file:
"#error "No supported window creation API selected"
After looking at where it came from, I found that internal.h was checking if I used either the win32, cocoa or x11 platform:
#if defined(_GLFW_COCOA)
#include "cocoa_platform.h"
#elif defined(_GLFW_WIN32)
#include "win32_platform.h"
#elif defined(_GLFW_X11)
#include "x11_platform.h"
#else
#error "No supported window creation API selected"
#endif
Because I installed other libraries with dependencies on xorg, and these seem to work just fine, I forced it to use x11_platform.h (via defining _GLFW_X11 in a provided config.h file.).
Then ran the make command a second time. Next Error would be in the x11_platform.h file:
"#error "No supported context creation API selected"
It seemed to be pretty much the same as above, just with GLX and EGL:
#if defined(_GLFW_GLX)
#define _GLFW_X11_CONTEXT_VISUAL window->glx.visual
#include "glx_platform.h"
#elif defined(_GLFW_EGL)
#define _GLFW_X11_CONTEXT_VISUAL window->egl.visual
#define _GLFW_EGL_NATIVE_WINDOW window->x11.handle
#define _GLFW_EGL_NATIVE_DISPLAY _glfw.x11.display
#include "egl_platform.h"
#else
#error "No supported context creation API selected"
#endif
This time I did a bit of research on what the heck these are supposed to be (and checked if I had these mesa thingys for egl). As it seems, people say egl is the future. So I defined _GLFW_EGL in the config.h file.
Yeah, you guessed it, next Error. This time even fatal D: In egl_platform.h (I actually tried using GLX after this error, same thing)
"fatal error: ../deps/EGL/eglext.h: No such file or directory"
I then searched my computer for a eglext.h, and found one in my /usr/include/EGL
So I edited the Box2D/glfw/egl_platform.h file, theres actually a note that I maybe would have to change the path of the eglext.h thing. So I did.
#include "/usr/include/EGL/eglext.h"
And this make, it actually got to 100% !!! But then this happened: http://pastebin.com/bS2qY2KC And I have NO f*ing clue what this is supposed to mean... All I understand is that some functions are calling some things in a libglfw.a that they cant read. I checked if I even have this libglfw.a file, indeed I do under /usr/lib/x86_64-linux-gnu. I searched around a bit, and got the idea that my glfw package I got through apt-get may be outdated/ broken, so I removed it and installed glfw manually from https://github.com/glfw/glfw
TL;DR:
Basically i got this while building Box2D: [see the pastebin above, for some stupid reason I am not allowed to post more than 2 links]
I have no clue what this should tell me. I saw that there is libglfw.a popping up all over the place, so I completely reinstalled glfw (manually) using its gitHub files. Still exactly the same.
I would be extremely thankful if there was someone who could tell me what is going on there.
EDIT: Here's how I managed to install it via cmake (as I tried above...): In the Build directory:
cmake -DBOX2D_INSTALL=ON -DBOX2D_BUILD_SHARED=ON -DBOX2D_BUILD_STATIC=OFF -DBOX2D_BUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=ON ..
sudo make
make install