Compiling GLFW on old linux

Hi! I’m trying to compile GLFW on a very outdated linux distro (which support is over) - for very old notebook.
My system is: Linux Mint 17.1 Rebecca (based on Ubuntu 14.04.6 LTS, Trusty Tahr).
I’m doing this:

git clone https://github.com/glfw/glfw.git
cd glfw/
cmake -S ~/src/glfw -B ~/src/glfw/build -D GLFW_BUILD_WAYLAND=0 -D BUILD_SHARED_LIBS=ON -D GLFW_BUILD_X11=ON
cd build
make

Getting errors like this:

[ 24%] Linking C shared library libglfw.so
[ 24%] Built target glfw
[ 25%] Building C object examples/CMakeFiles/boing.dir/boing.c.o
In file included from /home/user/src/glfw/examples/boing.c:44:0:
/home/user/src/glfw/deps/linmath.h: In function ‘mat4x4_mul’:
/home/user/src/glfw/deps/linmath.h:178:2: warning: passing argument 2 of ‘mat4x4_dup’ from incompatible pointer type [enabled by default]
  mat4x4_dup(M, temp);
  ^
/home/user/src/glfw/deps/linmath.h:117:21: note: expected ‘const float (*)[4]’ but argument is of type ‘float (*)[4]’
 LINMATH_H_FUNC void mat4x4_dup(mat4x4 M, mat4x4 const N)
                     ^
/home/user/src/glfw/deps/linmath.h: In function ‘mat4x4_translate_in_place’:
/home/user/src/glfw/deps/linmath.h:202:3: warning: passing argument 2 of ‘mat4x4_row’ from incompatible pointer type [enabled by default]
   mat4x4_row(r, M, i);
   ^
/home/user/src/glfw/deps/linmath.h:123:21: note: expected ‘const float (*)[4]’ but argument is of type ‘float (*)[4]’
 LINMATH_H_FUNC void mat4x4_row(vec4 r, mat4x4 const M, int i)
                     ^
/home/user/src/glfw/deps/linmath.h: In function ‘mat4x4_rotate’:
/home/user/src/glfw/deps/linmath.h:229:3: warning: passing argument 2 of ‘mat4x4_scale’ from incompatible pointer type [enabled by default]
   mat4x4_scale(S, S, s);
   ^
/home/user/src/glfw/deps/linmath.h:156:21: note: expected ‘const float (*)[4]’ but argument is of type ‘float (*)[4]’
 LINMATH_H_FUNC void mat4x4_scale(mat4x4 M, mat4x4 const a, float k)
                     ^
/home/user/src/glfw/deps/linmath.h:233:3: warning: passing argument 2 of ‘mat4x4_sub’ from incompatible pointer type [enabled by default]
   mat4x4_sub(C, C, T);
   ^
/home/user/src/glfw/deps/linmath.h:150:21: note: expected ‘const float (*)[4]’ but argument is of type ‘float (*)[4]’
 LINMATH_H_FUNC void mat4x4_sub(mat4x4 M, mat4x4 const a, mat4x4 const b)
                     ^
/home/user/src/glfw/deps/linmath.h:233:3: warning: passing argument 3 of ‘mat4x4_sub’ from incompatible pointer type [enabled by default]
   mat4x4_sub(C, C, T);
   ^
/home/user/src/glfw/deps/linmath.h:150:21: note: expected ‘const float (*)[4]’ but argument is of type ‘float (*)[4]’
 LINMATH_H_FUNC void mat4x4_sub(mat4x4 M, mat4x4 const a, mat4x4 const b)
                     ^
/home/user/src/glfw/deps/linmath.h:235:3: warning: passing argument 2 of ‘mat4x4_scale’ from incompatible pointer type [enabled by default]
   mat4x4_scale(C, C, c);
   ^
/home/user/src/glfw/deps/linmath.h:156:21: note: expected ‘const float (*)[4]’ but argument is of type ‘float (*)[4]’
 LINMATH_H_FUNC void mat4x4_scale(mat4x4 M, mat4x4 const a, float k)
                     ^
/home/user/src/glfw/deps/linmath.h:237:3: warning: passing argument 2 of ‘mat4x4_add’ from incompatible pointer type [enabled by default]
   mat4x4_add(T, T, C);
   ^
/home/user/src/glfw/deps/linmath.h:144:21: note: expected ‘const float (*)[4]’ but argument is of type ‘float (*)[4]’
 LINMATH_H_FUNC void mat4x4_add(mat4x4 M, mat4x4 const a, mat4x4 const b)
                     ^
/home/user/src/glfw/deps/linmath.h:237:3: warning: passing argument 3 of ‘mat4x4_add’ from incompatible pointer type [enabled by default]
   mat4x4_add(T, T, C);
   ^
/home/user/src/glfw/deps/linmath.h:144:21: note: expected ‘const float (*)[4]’ but argument is of type ‘float (*)[4]’
 LINMATH_H_FUNC void mat4x4_add(mat4x4 M, mat4x4 const a, mat4x4 const b)
                     ^
/home/user/src/glfw/deps/linmath.h:238:3: warning: passing argument 2 of ‘mat4x4_add’ from incompatible pointer type [enabled by default]
   mat4x4_add(T, T, S);
   ^
/home/user/src/glfw/deps/linmath.h:144:21: note: expected ‘const float (*)[4]’ but argument is of type ‘float (*)[4]’
 LINMATH_H_FUNC void mat4x4_add(mat4x4 M, mat4x4 const a, mat4x4 const b)
                     ^
/home/user/src/glfw/deps/linmath.h:238:3: warning: passing argument 3 of ‘mat4x4_add’ from incompatible pointer type [enabled by default]
   mat4x4_add(T, T, S);
   ^
/home/user/src/glfw/deps/linmath.h:144:21: note: expected ‘const float (*)[4]’ but argument is of type ‘float (*)[4]’
 LINMATH_H_FUNC void mat4x4_add(mat4x4 M, mat4x4 const a, mat4x4 const b)
                     ^
/home/user/src/glfw/deps/linmath.h:241:3: warning: passing argument 3 of ‘mat4x4_mul’ from incompatible pointer type [enabled by default]
   mat4x4_mul(R, M, T);
   ^
/home/user/src/glfw/deps/linmath.h:169:21: note: expected ‘const float (*)[4]’ but argument is of type ‘float (*)[4]’
 LINMATH_H_FUNC void mat4x4_mul(mat4x4 M, mat4x4 const a, mat4x4 const b)
                     ^
/home/user/src/glfw/deps/linmath.h: In function ‘mat4x4_rotate_X’:
/home/user/src/glfw/deps/linmath.h:256:2: warning: passing argument 3 of ‘mat4x4_mul’ from incompatible pointer type [enabled by default]
  mat4x4_mul(Q, M, R);
  ^
/home/user/src/glfw/deps/linmath.h:169:21: note: expected ‘const float (*)[4]’ but argument is of type ‘float (*)[4]’
 LINMATH_H_FUNC void mat4x4_mul(mat4x4 M, mat4x4 const a, mat4x4 const b)
                     ^
/home/user/src/glfw/deps/linmath.h: In function ‘mat4x4_rotate_Y’:
/home/user/src/glfw/deps/linmath.h:268:2: warning: passing argument 3 of ‘mat4x4_mul’ from incompatible pointer type [enabled by default]
  mat4x4_mul(Q, M, R);
  ^
/home/user/src/glfw/deps/linmath.h:169:21: note: expected ‘const float (*)[4]’ but argument is of type ‘float (*)[4]’
 LINMATH_H_FUNC void mat4x4_mul(mat4x4 M, mat4x4 const a, mat4x4 const b)
                     ^
/home/user/src/glfw/deps/linmath.h: In function ‘mat4x4_rotate_Z’:
/home/user/src/glfw/deps/linmath.h:280:2: warning: passing argument 3 of ‘mat4x4_mul’ from incompatible pointer type [enabled by default]
  mat4x4_mul(Q, M, R);
  ^
/home/user/src/glfw/deps/linmath.h:169:21: note: expected ‘const float (*)[4]’ but argument is of type ‘float (*)[4]’
 LINMATH_H_FUNC void mat4x4_mul(mat4x4 M, mat4x4 const a, mat4x4 const b)
                     ^
[ 26%] Linking C executable boing
[ 26%] Built target boing

I’m don’t know how to attach a full log to this post.
What’s wrong with compiling?

Those appear to be warnings rather than errors, and the target boing appeared to build. If they are just all from linmath.h then this is only used in the examples, so the GLFW libraries should build without warnings.

You could potentially look into updating your compiler, as the warnings look incorrect to me.

ok, thanx, i will try to do this

Most probably a compiler (or glibc?) issue. I would recommend switching to an operating system that’s more recent and therefore has a recent glibc and compilers. I use GLFW in two old netbooks without any issues.

There are some lightweight distributions for such old machines. I am using antiX which is designed mainly for old computers, while still providing very recent versions of compilers and libraries. Void is also a very good choice (not specifically for old computers but works well in oldies anyway). I’m sure there are others too, but those two are the ones I have tried in 15+ years old 32-bit netbooks with 1 Gb of RAM, and they work pretty well. You can either compile GLFW yourself, or use their package manager (both distributions have GLFW available in their repositories, and it’s usually up-to-date).