memononen / nanovg

Antialiased 2D vector drawing library on top of OpenGL for UI and visualizations.
zlib License
5.07k stars 767 forks source link

Can't compile on void linux #547

Open LinArcX opened 4 years ago

LinArcX commented 4 years ago

Hi. i want to compile nanovg. first create make files via:

╰ premake4 gmake
Building configurations...
Running action 'gmake'...
Generating build/Makefile...
Generating build/nanovg.make...
Generating build/example_gl2.make...
Generating build/example_gl3.make...
Generating build/example_gl2_msaa.make...
Generating build/example_gl3_msaa.make...
Generating build/example_fbo.make...
Generating build/example_gles2.make...
Generating build/example_gles3.make...
Done.

Then switch to build dir:

╰ cd build 

And finaly make:

╰ make
==== Building nanovg (debug) ====
Creating obj/Debug/nanovg
nanovg.c
In file included from ../src/fontstash.h:262,
                 from ../src/nanovg.c:26:
../src/stb_truetype.h: In function 'stbtt__rasterize_sorted_edges':
../src/stb_truetype.h:2067:93: warning: unused parameter 'vsubsample' [-Wunused-parameter]
 2067 | static void stbtt__rasterize_sorted_edges(stbtt__bitmap *result, stbtt__edge *e, int n, int vsubsample, int off_x, int off_y, void *userdata)
      |                                                                                         ~~~~^~~~~~~~~~
In file included from ../src/nanovg.c:26:
../src/fontstash.h: In function 'fonsAddFont':
../src/fontstash.h:911:13: warning: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
  911 |  if (readed != dataSize) goto error;
      |             ^~
In file included from ../src/nanovg.c:28:
../src/stb_image.h: In function 'stbi__convert_format':
../src/stb_image.h:1359:44: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
 1359 |       #define CASE(a,b)   case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)
      |                                            ^~~
../src/stb_image.h:1363:10: note: in expansion of macro 'CASE'
 1363 |          CASE(1,2) dest[0]=src[0], dest[1]=255; break;
      |          ^~~~
../src/stb_image.h:1363:49: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
 1363 |          CASE(1,2) dest[0]=src[0], dest[1]=255; break;
      |                                                 ^~~~~
../src/stb_image.h:1359:44: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
 1359 |       #define CASE(a,b)   case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)
      |                                            ^~~
../src/stb_image.h:1364:10: note: in expansion of macro 'CASE'
 1364 |          CASE(1,3) dest[0]=dest[1]=dest[2]=src[0]; break;
      |          ^~~~
../src/stb_image.h:1364:52: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
 1364 |          CASE(1,3) dest[0]=dest[1]=dest[2]=src[0]; break;
      |                                                    ^~~~~
../src/stb_image.h:1359:44: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
 1359 |       #define CASE(a,b)   case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)
      |                                            ^~~
../src/stb_image.h:1365:10: note: in expansion of macro 'CASE'
 1365 |          CASE(1,4) dest[0]=dest[1]=dest[2]=src[0], dest[3]=255; break;
      |          ^~~~
../src/stb_image.h:1365:65: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
 1365 |          CASE(1,4) dest[0]=dest[1]=dest[2]=src[0], dest[3]=255; break;
      |                                                                 ^~~~~
../src/stb_image.h:1359:44: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
 1359 |       #define CASE(a,b)   case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)
      |                                            ^~~
../src/stb_image.h:1366:10: note: in expansion of macro 'CASE'
 1366 |          CASE(2,1) dest[0]=src[0]; break;
      |          ^~~~
../src/stb_image.h:1366:36: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
 1366 |          CASE(2,1) dest[0]=src[0]; break;
      |                                    ^~~~~
../src/stb_image.h:1359:44: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
 1359 |       #define CASE(a,b)   case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)
      |                                            ^~~
../src/stb_image.h:1367:10: note: in expansion of macro 'CASE'
 1367 |          CASE(2,3) dest[0]=dest[1]=dest[2]=src[0]; break;
      |          ^~~~
../src/stb_image.h:1367:52: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
 1367 |          CASE(2,3) dest[0]=dest[1]=dest[2]=src[0]; break;
      |                                                    ^~~~~
../src/stb_image.h:1359:44: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
 1359 |       #define CASE(a,b)   case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)
      |                                            ^~~
../src/stb_image.h:1368:10: note: in expansion of macro 'CASE'
 1368 |          CASE(2,4) dest[0]=dest[1]=dest[2]=src[0], dest[3]=src[1]; break;
      |          ^~~~
../src/stb_image.h:1368:68: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
 1368 |          CASE(2,4) dest[0]=dest[1]=dest[2]=src[0], dest[3]=src[1]; break;
      |                                                                    ^~~~~
../src/stb_image.h:1359:44: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
 1359 |       #define CASE(a,b)   case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)
      |                                            ^~~
../src/stb_image.h:1369:10: note: in expansion of macro 'CASE'
 1369 |          CASE(3,4) dest[0]=src[0],dest[1]=src[1],dest[2]=src[2],dest[3]=255; break;
      |          ^~~~
../src/stb_image.h:1369:78: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
 1369 |          CASE(3,4) dest[0]=src[0],dest[1]=src[1],dest[2]=src[2],dest[3]=255; break;
      |                                                                              ^~~~~
../src/stb_image.h:1359:44: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
 1359 |       #define CASE(a,b)   case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)
      |                                            ^~~
../src/stb_image.h:1370:10: note: in expansion of macro 'CASE'
 1370 |          CASE(3,1) dest[0]=stbi__compute_y(src[0],src[1],src[2]); break;
      |          ^~~~
../src/stb_image.h:1370:67: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
 1370 |          CASE(3,1) dest[0]=stbi__compute_y(src[0],src[1],src[2]); break;
      |                                                                   ^~~~~
../src/stb_image.h:1359:44: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
 1359 |       #define CASE(a,b)   case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)
      |                                            ^~~
../src/stb_image.h:1371:10: note: in expansion of macro 'CASE'
 1371 |          CASE(3,2) dest[0]=stbi__compute_y(src[0],src[1],src[2]), dest[1] = 255; break;
      |          ^~~~
../src/stb_image.h:1371:82: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
 1371 |          CASE(3,2) dest[0]=stbi__compute_y(src[0],src[1],src[2]), dest[1] = 255; break;
      |                                                                                  ^~~~~
../src/stb_image.h:1359:44: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
 1359 |       #define CASE(a,b)   case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)
      |                                            ^~~
../src/stb_image.h:1372:10: note: in expansion of macro 'CASE'
 1372 |          CASE(4,1) dest[0]=stbi__compute_y(src[0],src[1],src[2]); break;
      |          ^~~~
../src/stb_image.h:1372:67: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
 1372 |          CASE(4,1) dest[0]=stbi__compute_y(src[0],src[1],src[2]); break;
      |                                                                   ^~~~~
../src/stb_image.h:1359:44: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
 1359 |       #define CASE(a,b)   case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)
      |                                            ^~~
../src/stb_image.h:1373:10: note: in expansion of macro 'CASE'
 1373 |          CASE(4,2) dest[0]=stbi__compute_y(src[0],src[1],src[2]), dest[1] = src[3]; break;
      |          ^~~~
../src/stb_image.h:1373:85: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
 1373 |          CASE(4,2) dest[0]=stbi__compute_y(src[0],src[1],src[2]), dest[1] = src[3]; break;
      |                                                                                     ^~~~~
../src/stb_image.h:1359:44: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
 1359 |       #define CASE(a,b)   case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)
      |                                            ^~~
../src/stb_image.h:1374:10: note: in expansion of macro 'CASE'
 1374 |          CASE(4,3) dest[0]=src[0],dest[1]=src[1],dest[2]=src[2]; break;
      |          ^~~~
../src/stb_image.h:1374:66: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
 1374 |          CASE(4,3) dest[0]=src[0],dest[1]=src[1],dest[2]=src[2]; break;
      |                                                                  ^~~~~
../src/stb_image.h: In function 'stbi__build_fast_ac':
../src/stb_image.h:1578:33: warning: left shift of negative value [-Wshift-negative-value]
 1578 |             if (k < m) k += (-1 << magbits) + 1;
      |                                 ^~
../src/stb_image.h: In function 'stbi__create_png_image_raw':
../src/stb_image.h:4049:17: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
 4049 |                 for (k=0; k < nk; ++k)
      |                 ^~~
../src/stb_image.h:4053:13: note: in expansion of macro 'CASE'
 4053 |             CASE(STBI__F_sub)          cur[k] = STBI__BYTECAST(raw[k] + cur[k-filter_bytes]); break;
      |             ^~~~
../src/stb_image.h:4053:95: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
 4053 |             CASE(STBI__F_sub)          cur[k] = STBI__BYTECAST(raw[k] + cur[k-filter_bytes]); break;
      |                                                                                               ^~~~~
../src/stb_image.h:4049:17: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
 4049 |                 for (k=0; k < nk; ++k)
      |                 ^~~
../src/stb_image.h:4054:13: note: in expansion of macro 'CASE'
 4054 |             CASE(STBI__F_up)           cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break;
      |             ^~~~
../src/stb_image.h:4054:84: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
 4054 |             CASE(STBI__F_up)           cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break;
      |                                                                                    ^~~~~
../src/stb_image.h:4049:17: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
 4049 |                 for (k=0; k < nk; ++k)
      |                 ^~~
../src/stb_image.h:4055:13: note: in expansion of macro 'CASE'
 4055 |             CASE(STBI__F_avg)          cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k-filter_bytes])>>1)); break;
      |             ^~~~
../src/stb_image.h:4055:113: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
 4055 |             CASE(STBI__F_avg)          cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k-filter_bytes])>>1)); break;
      |                                                                                                                 ^~~~~
../src/stb_image.h:4049:17: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
 4049 |                 for (k=0; k < nk; ++k)
      |                 ^~~
../src/stb_image.h:4056:13: note: in expansion of macro 'CASE'
 4056 |             CASE(STBI__F_paeth)        cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],prior[k],prior[k-filter_bytes])); break;
      |             ^~~~
../src/stb_image.h:4056:139: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
 4056 |             CASE(STBI__F_paeth)        cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],prior[k],prior[k-filter_bytes])); break;
      |                                                                                                                                           ^~~~~
../src/stb_image.h:4049:17: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
 4049 |                 for (k=0; k < nk; ++k)
      |                 ^~~
../src/stb_image.h:4057:13: note: in expansion of macro 'CASE'
 4057 |             CASE(STBI__F_avg_first)    cur[k] = STBI__BYTECAST(raw[k] + (cur[k-filter_bytes] >> 1)); break;
      |             ^~~~
../src/stb_image.h:4057:102: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
 4057 |             CASE(STBI__F_avg_first)    cur[k] = STBI__BYTECAST(raw[k] + (cur[k-filter_bytes] >> 1)); break;
      |                                                                                                      ^~~~~
../src/stb_image.h:4049:17: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
 4049 |                 for (k=0; k < nk; ++k)
      |                 ^~~
../src/stb_image.h:4058:13: note: in expansion of macro 'CASE'
 4058 |             CASE(STBI__F_paeth_first)  cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],0,0)); break;
      |             ^~~~
../src/stb_image.h:4058:112: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
 4058 |             CASE(STBI__F_paeth_first)  cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],0,0)); break;
      |                                                                                                                ^~~~~
../src/stb_image.h:4067:20: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
 4067 |                    for (k=0; k < img_n; ++k)
      |                    ^~~
../src/stb_image.h:4069:13: note: in expansion of macro 'CASE'
 4069 |             CASE(STBI__F_none)         cur[k] = raw[k]; break;
      |             ^~~~
../src/stb_image.h:4069:57: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
 4069 |             CASE(STBI__F_none)         cur[k] = raw[k]; break;
      |                                                         ^~~~~
../src/stb_image.h:4067:20: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
 4067 |                    for (k=0; k < img_n; ++k)
      |                    ^~~
../src/stb_image.h:4070:13: note: in expansion of macro 'CASE'
 4070 |             CASE(STBI__F_sub)          cur[k] = STBI__BYTECAST(raw[k] + cur[k-out_n]); break;
      |             ^~~~
../src/stb_image.h:4070:88: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
 4070 |             CASE(STBI__F_sub)          cur[k] = STBI__BYTECAST(raw[k] + cur[k-out_n]); break;
      |                                                                                        ^~~~~
../src/stb_image.h:4067:20: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
 4067 |                    for (k=0; k < img_n; ++k)
      |                    ^~~
../src/stb_image.h:4071:13: note: in expansion of macro 'CASE'
 4071 |             CASE(STBI__F_up)           cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break;
      |             ^~~~
../src/stb_image.h:4071:84: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
 4071 |             CASE(STBI__F_up)           cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break;
      |                                                                                    ^~~~~
../src/stb_image.h:4067:20: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
 4067 |                    for (k=0; k < img_n; ++k)
      |                    ^~~
../src/stb_image.h:4072:13: note: in expansion of macro 'CASE'
 4072 |             CASE(STBI__F_avg)          cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k-out_n])>>1)); break;
      |             ^~~~
../src/stb_image.h:4072:106: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
 4072 |             CASE(STBI__F_avg)          cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k-out_n])>>1)); break;
      |                                                                                                          ^~~~~
../src/stb_image.h:4067:20: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
 4067 |                    for (k=0; k < img_n; ++k)
      |                    ^~~
../src/stb_image.h:4073:13: note: in expansion of macro 'CASE'
 4073 |             CASE(STBI__F_paeth)        cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-out_n],prior[k],prior[k-out_n])); break;
      |             ^~~~
../src/stb_image.h:4073:125: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
 4073 |             CASE(STBI__F_paeth)        cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-out_n],prior[k],prior[k-out_n])); break;
      |                                                                                                                             ^~~~~
../src/stb_image.h:4067:20: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
 4067 |                    for (k=0; k < img_n; ++k)
      |                    ^~~
../src/stb_image.h:4074:13: note: in expansion of macro 'CASE'
 4074 |             CASE(STBI__F_avg_first)    cur[k] = STBI__BYTECAST(raw[k] + (cur[k-out_n] >> 1)); break;
      |             ^~~~
../src/stb_image.h:4074:95: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
 4074 |             CASE(STBI__F_avg_first)    cur[k] = STBI__BYTECAST(raw[k] + (cur[k-out_n] >> 1)); break;
      |                                                                                               ^~~~~
../src/stb_image.h:4067:20: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
 4067 |                    for (k=0; k < img_n; ++k)
      |                    ^~~
../src/stb_image.h:4075:13: note: in expansion of macro 'CASE'
 4075 |             CASE(STBI__F_paeth_first)  cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-out_n],0,0)); break;
      |             ^~~~
../src/stb_image.h:4075:105: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
 4075 |             CASE(STBI__F_paeth_first)  cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-out_n],0,0)); break;
      |                                                                                                         ^~~~~
../src/stb_image.h: In function 'stbi__tga_get_comp':
../src/stb_image.h:4856:18: warning: this statement may fall through [-Wimplicit-fallthrough=]
 4856 |       case 16: if(is_grey) return STBI_grey_alpha;
      |                  ^
../src/stb_image.h:4858:7: note: here
 4858 |       case 15: if(is_rgb16) *is_rgb16 = 1;
      |       ^~~~
Linking nanovg
==== Building example_gl2 (debug) ====
Creating obj/Debug/example_gl2
example_gl2.c
In file included from /usr/include/GLFW/glfw3.h:204,
                 from ../example/example_gl2.c:24:
/usr/include/GL/glext.h:12066:25: error: conflicting types for 'PFNGLFRAGMENTLIGHTFVSGIXPROC'
12066 | typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../example/example_gl2.c:21:
/usr/include/GL/glew.h:18734:28: note: previous declaration of 'PFNGLFRAGMENTLIGHTFVSGIXPROC' was here
18734 | typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat* params);
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/GLFW/glfw3.h:204,
                 from ../example/example_gl2.c:24:
/usr/include/GL/glext.h:12068:25: error: conflicting types for 'PFNGLFRAGMENTLIGHTIVSGIXPROC'
12068 | typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../example/example_gl2.c:21:
/usr/include/GL/glew.h:18736:28: note: previous declaration of 'PFNGLFRAGMENTLIGHTIVSGIXPROC' was here
18736 | typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint* params);
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/GLFW/glfw3.h:204,
                 from ../example/example_gl2.c:24:
/usr/include/GL/glext.h:12070:25: error: conflicting types for 'PFNGLFRAGMENTLIGHTMODELFVSGIXPROC'
12070 | typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../example/example_gl2.c:21:
/usr/include/GL/glew.h:18730:28: note: previous declaration of 'PFNGLFRAGMENTLIGHTMODELFVSGIXPROC' was here
18730 | typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, GLfloat* params);
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/GLFW/glfw3.h:204,
                 from ../example/example_gl2.c:24:
/usr/include/GL/glext.h:12072:25: error: conflicting types for 'PFNGLFRAGMENTLIGHTMODELIVSGIXPROC'
12072 | typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../example/example_gl2.c:21:
/usr/include/GL/glew.h:18732:28: note: previous declaration of 'PFNGLFRAGMENTLIGHTMODELIVSGIXPROC' was here
18732 | typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, GLint* params);
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/GLFW/glfw3.h:204,
                 from ../example/example_gl2.c:24:
/usr/include/GL/glext.h:12079:25: error: conflicting types for 'PFNGLGETFRAGMENTMATERIALFVSGIXPROC'
12079 | typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../example/example_gl2.c:21:
/usr/include/GL/glew.h:18743:28: note: previous declaration of 'PFNGLGETFRAGMENTMATERIALFVSGIXPROC' was here
18743 | typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* data);
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/GLFW/glfw3.h:204,
                 from ../example/example_gl2.c:24:
/usr/include/GL/glext.h:12080:25: error: conflicting types for 'PFNGLGETFRAGMENTMATERIALIVSGIXPROC'
12080 | typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../example/example_gl2.c:21:
/usr/include/GL/glew.h:18744:28: note: previous declaration of 'PFNGLGETFRAGMENTMATERIALIVSGIXPROC' was here
18744 | typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* data);
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[1]: *** [example_gl2.make:219: obj/Debug/example_gl2/example_gl2.o] Error 1
make: *** [Makefile:21: example_gl2] Error 2

Tip: I installed glfw-devel and glew-devel on my system.

SiliconWizard commented 4 years ago

Hello,

I ran into the same problem on Arch Linux. Actually, most distributions are probably affected by this. It comes from a recent (a few months?) incompatibility between GLEXT and GLEW on systems with MESA. This is not a problem typically with nanovg itself, although it affects some of the example programs and your overall use of GLFW.

See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=915112

You can try reporting this to your Linux distribution's team, and/or to the developers of GLEW and/or GLFW. It's been known for a few months, but still no fix on most distributions for now.

One quick temporary fix would be NOT to define GLFW_INCLUDE_GLEXT before including <GLFW/glfw3.h>. You won't get access to GLEXT though. I don't know how problematic or critical that would be. Probably not really just to build the examples. For your own developments, I don't know. See GLFW's documentation for how it uses GLEXT...

SiliconWizard commented 4 years ago

Quick update: this has been fixed in GLEW. You need to update GLEW from git currently, has the fix has not made it to an official release as of yet. On Arch Linux, installing glew-git from AUR works.

cbix commented 4 years ago

On Arch Linux, installing glew-git from AUR works.

I can confirm this!

AlbertoGP commented 3 years ago

I’m on Void Linux and nanovg compiles fine now. It has been working since I first tried a few months ago.

$ xbps-query -Rs glew
[*] glew-2.2.0_1       OpenGL Extension Wrangler Library
[*] glew-devel-2.2.0_1 OpenGL Extension Wrangler Library - development files