Osmium
Osmium copied to clipboard
Errors encounted while trying to compile Osmium
I'm on Ubuntu 22.03 LTS, with necessary dependencies installed. I encountered the following error while trying to compiler Osmium, it seems has something to do with the code:
gcc -std=gnu11 -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/render.d" -MT"src/render.d" -o "src/render.o" "../src/render.c"
In file included from ../src/render.h:12,
from ../src/render.c:8:
../src/models.h:622:48: warning: ‘struct vertex_tex’ declared inside parameter list will not be visible outside of this definition or declaration
622 | void createModelCube(struct modr* modr, struct vertex_tex* vexs, float x, float y, float z, int width, int height, int depth, float scale, int mirror);
| ^~~~~~~~~~
../src/render.c: In function ‘createVAO’:
../src/render.c:37:25: warning: implicit declaration of function ‘glGenVertexArrays’ [-Wimplicit-function-declaration]
37 | if (!overwrite) glGenVertexArrays(1, &vao->vao);
| ^~~~~~~~~~~~~~~~~
../src/render.c:38:9: warning: implicit declaration of function ‘glBindVertexArray’ [-Wimplicit-function-declaration]
38 | glBindVertexArray(vao->vao);
| ^~~~~~~~~~~~~~~~~
../src/render.c:40:17: warning: implicit declaration of function ‘glGenBuffers’; did you mean ‘glReadBuffer’? [-Wimplicit-function-declaration]
40 | glGenBuffers(1, &vao->vbo);
| ^~~~~~~~~~~~
| glReadBuffer
../src/render.c:43:9: warning: implicit declaration of function ‘glBindBuffer’; did you mean ‘glReadBuffer’? [-Wimplicit-function-declaration]
43 | glBindBuffer(GL_ARRAY_BUFFER, vao->vbo);
| ^~~~~~~~~~~~
| glReadBuffer
../src/render.c:44:9: warning: implicit declaration of function ‘glBufferData’ [-Wimplicit-function-declaration]
44 | glBufferData(GL_ARRAY_BUFFER, count * (textures ? sizeof(struct vertex_tex) : sizeof(struct vertex)), verticies, GL_STATIC_DRAW);
| ^~~~~~~~~~~~
../src/render.c:63:22: warning: implicit declaration of function ‘glVertexAttribIPointer’; did you mean ‘glVertexPointer’? [-Wimplicit-function-declaration]
63 | if (vattrib) glVertexAttribIPointer(0, 1, vattrib, (textures ? sizeof(struct vertex_tex) : sizeof(struct vertex)) + rz, (void*) (sizeof(struct vertex_tex)));
| ^~~~~~~~~~~~~~~~~~~~~~
| glVertexPointer
../src/render.c: In function ‘deleteVAO’:
../src/render.c:69:9: warning: implicit declaration of function ‘glDeleteBuffers’; did you mean ‘glSelectBuffer’? [-Wimplicit-function-declaration]
69 | glDeleteBuffers(1, &vao->vbo);
| ^~~~~~~~~~~~~~~
| glSelectBuffer
../src/render.c:71:9: warning: implicit declaration of function ‘glDeleteVertexArrays’ [-Wimplicit-function-declaration]
71 | glDeleteVertexArrays(1, &vao->vao);
| ^~~~~~~~~~~~~~~~~~~~
../src/render.c: In function ‘createMultSub’:
../src/render.c:86:30: warning: passing argument 1 of ‘virtVertex3f’ from incompatible pointer type [-Wincompatible-pointer-types]
86 | virtVertex3f(&vrt[vx++], -xwid + x, -ywid + y, zwid + z);
| ^~~~~~~~~~
| |
| struct vertex_tex *
../src/render.c:25:34: note: expected ‘union uvertex *’ but argument is of type ‘struct vertex_tex *’
25 | void virtVertex3f(union uvertex* vert, float x, float y, float z) {
| ~~~~~~~~~~~~~~~^~~~
../src/render.c:88:30: warning: passing argument 1 of ‘virtVertex3f’ from incompatible pointer type [-Wincompatible-pointer-types]
88 | virtVertex3f(&vrt[vx++], xwid + x, -ywid + y, zwid + z);
| ^~~~~~~~~~
| |
| struct vertex_tex *
../src/render.c:25:34: note: expected ‘union uvertex *’ but argument is of type ‘struct vertex_tex *’
25 | void virtVertex3f(union uvertex* vert, float x, float y, float z) {
| ~~~~~~~~~~~~~~~^~~~
../src/render.c:90:30: warning: passing argument 1 of ‘virtVertex3f’ from incompatible pointer type [-Wincompatible-pointer-types]
90 | virtVertex3f(&vrt[vx++], xwid + x, ywid + y, zwid + z);
| ^~~~~~~~~~
| |
| struct vertex_tex *
../src/render.c:25:34: note: expected ‘union uvertex *’ but argument is of type ‘struct vertex_tex *’
25 | void virtVertex3f(union uvertex* vert, float x, float y, float z) {
| ~~~~~~~~~~~~~~~^~~~
../src/render.c:92:30: warning: passing argument 1 of ‘virtVertex3f’ from incompatible pointer type [-Wincompatible-pointer-types]
92 | virtVertex3f(&vrt[vx++], -xwid + x, ywid + y, zwid + z);
| ^~~~~~~~~~
| |
| struct vertex_tex *
../src/render.c:25:34: note: expected ‘union uvertex *’ but argument is of type ‘struct vertex_tex *’
25 | void virtVertex3f(union uvertex* vert, float x, float y, float z) {
| ~~~~~~~~~~~~~~~^~~~
../src/render.c:96:30: warning: passing argument 1 of ‘virtVertex3f’ from incompatible pointer type [-Wincompatible-pointer-types]
96 | virtVertex3f(&vrt[vx++], -xwid + x, -ywid + y, -zwid + z);
| ^~~~~~~~~~
| |
| struct vertex_tex *
../src/render.c:25:34: note: expected ‘union uvertex *’ but argument is of type ‘struct vertex_tex *’
25 | void virtVertex3f(union uvertex* vert, float x, float y, float z) {
| ~~~~~~~~~~~~~~~^~~~
../src/render.c:98:30: warning: passing argument 1 of ‘virtVertex3f’ from incompatible pointer type [-Wincompatible-pointer-types]
98 | virtVertex3f(&vrt[vx++], -xwid + x, ywid + y, -zwid + z);
| ^~~~~~~~~~
| |
| struct vertex_tex *
../src/render.c:25:34: note: expected ‘union uvertex *’ but argument is of type ‘struct vertex_tex *’
25 | void virtVertex3f(union uvertex* vert, float x, float y, float z) {
| ~~~~~~~~~~~~~~~^~~~
../src/render.c:100:30: warning: passing argument 1 of ‘virtVertex3f’ from incompatible pointer type [-Wincompatible-pointer-types]
100 | virtVertex3f(&vrt[vx++], xwid + x, ywid + y, -zwid + z);
| ^~~~~~~~~~
| |
| struct vertex_tex *
../src/render.c:25:34: note: expected ‘union uvertex *’ but argument is of type ‘struct vertex_tex *’
25 | void virtVertex3f(union uvertex* vert, float x, float y, float z) {
| ~~~~~~~~~~~~~~~^~~~
../src/render.c:102:30: warning: passing argument 1 of ‘virtVertex3f’ from incompatible pointer type [-Wincompatible-pointer-types]
102 | virtVertex3f(&vrt[vx++], xwid + x, -ywid + y, -zwid + z);
| ^~~~~~~~~~
| |
| struct vertex_tex *
../src/render.c:25:34: note: expected ‘union uvertex *’ but argument is of type ‘struct vertex_tex *’
25 | void virtVertex3f(union uvertex* vert, float x, float y, float z) {
| ~~~~~~~~~~~~~~~^~~~
../src/render.c:107:30: warning: passing argument 1 of ‘virtVertex3f’ from incompatible pointer type [-Wincompatible-pointer-types]
107 | virtVertex3f(&vrt[vx++], -xwid + x, ywid + y, -zwid + z);
| ^~~~~~~~~~
| |
| struct vertex_tex *
../src/render.c:25:34: note: expected ‘union uvertex *’ but argument is of type ‘struct vertex_tex *’
25 | void virtVertex3f(union uvertex* vert, float x, float y, float z) {
| ~~~~~~~~~~~~~~~^~~~
../src/render.c:109:30: warning: passing argument 1 of ‘virtVertex3f’ from incompatible pointer type [-Wincompatible-pointer-types]
109 | virtVertex3f(&vrt[vx++], -xwid + x, ywid + y, zwid + z);
| ^~~~~~~~~~
| |
| struct vertex_tex *
../src/render.c:25:34: note: expected ‘union uvertex *’ but argument is of type ‘struct vertex_tex *’
25 | void virtVertex3f(union uvertex* vert, float x, float y, float z) {
| ~~~~~~~~~~~~~~~^~~~
../src/render.c:111:30: warning: passing argument 1 of ‘virtVertex3f’ from incompatible pointer type [-Wincompatible-pointer-types]
111 | virtVertex3f(&vrt[vx++], xwid + x, ywid + y, zwid + z);
| ^~~~~~~~~~
| |
| struct vertex_tex *
../src/render.c:25:34: note: expected ‘union uvertex *’ but argument is of type ‘struct vertex_tex *’
25 | void virtVertex3f(union uvertex* vert, float x, float y, float z) {
| ~~~~~~~~~~~~~~~^~~~
../src/render.c:113:30: warning: passing argument 1 of ‘virtVertex3f’ from incompatible pointer type [-Wincompatible-pointer-types]
113 | virtVertex3f(&vrt[vx++], xwid + x, ywid + y, -zwid + z);
| ^~~~~~~~~~
| |
| struct vertex_tex *
../src/render.c:25:34: note: expected ‘union uvertex *’ but argument is of type ‘struct vertex_tex *’
25 | void virtVertex3f(union uvertex* vert, float x, float y, float z) {
| ~~~~~~~~~~~~~~~^~~~
../src/render.c:117:30: warning: passing argument 1 of ‘virtVertex3f’ from incompatible pointer type [-Wincompatible-pointer-types]
117 | virtVertex3f(&vrt[vx++], -xwid + x, -ywid + y, -zwid + z);
| ^~~~~~~~~~
| |
| struct vertex_tex *
../src/render.c:25:34: note: expected ‘union uvertex *’ but argument is of type ‘struct vertex_tex *’
25 | void virtVertex3f(union uvertex* vert, float x, float y, float z) {
| ~~~~~~~~~~~~~~~^~~~
../src/render.c:119:30: warning: passing argument 1 of ‘virtVertex3f’ from incompatible pointer type [-Wincompatible-pointer-types]
119 | virtVertex3f(&vrt[vx++], xwid + x, -ywid + y, -zwid + z);
| ^~~~~~~~~~
| |
| struct vertex_tex *
../src/render.c:25:34: note: expected ‘union uvertex *’ but argument is of type ‘struct vertex_tex *’
25 | void virtVertex3f(union uvertex* vert, float x, float y, float z) {
| ~~~~~~~~~~~~~~~^~~~
../src/render.c:121:30: warning: passing argument 1 of ‘virtVertex3f’ from incompatible pointer type [-Wincompatible-pointer-types]
121 | virtVertex3f(&vrt[vx++], xwid + x, -ywid + y, zwid + z);
| ^~~~~~~~~~
| |
| struct vertex_tex *
../src/render.c:25:34: note: expected ‘union uvertex *’ but argument is of type ‘struct vertex_tex *’
25 | void virtVertex3f(union uvertex* vert, float x, float y, float z) {
| ~~~~~~~~~~~~~~~^~~~
../src/render.c:123:30: warning: passing argument 1 of ‘virtVertex3f’ from incompatible pointer type [-Wincompatible-pointer-types]
123 | virtVertex3f(&vrt[vx++], -xwid + x, -ywid + y, zwid + z);
| ^~~~~~~~~~
| |
| struct vertex_tex *
../src/render.c:25:34: note: expected ‘union uvertex *’ but argument is of type ‘struct vertex_tex *’
25 | void virtVertex3f(union uvertex* vert, float x, float y, float z) {
| ~~~~~~~~~~~~~~~^~~~
../src/render.c:128:30: warning: passing argument 1 of ‘virtVertex3f’ from incompatible pointer type [-Wincompatible-pointer-types]
128 | virtVertex3f(&vrt[vx++], xwid + x, -ywid + y, -zwid + z);
| ^~~~~~~~~~
| |
| struct vertex_tex *
../src/render.c:25:34: note: expected ‘union uvertex *’ but argument is of type ‘struct vertex_tex *’
25 | void virtVertex3f(union uvertex* vert, float x, float y, float z) {
| ~~~~~~~~~~~~~~~^~~~
../src/render.c:130:30: warning: passing argument 1 of ‘virtVertex3f’ from incompatible pointer type [-Wincompatible-pointer-types]
130 | virtVertex3f(&vrt[vx++], xwid + x, ywid + y, -zwid + z);
| ^~~~~~~~~~
| |
| struct vertex_tex *
../src/render.c:25:34: note: expected ‘union uvertex *’ but argument is of type ‘struct vertex_tex *’
25 | void virtVertex3f(union uvertex* vert, float x, float y, float z) {
| ~~~~~~~~~~~~~~~^~~~
../src/render.c:132:30: warning: passing argument 1 of ‘virtVertex3f’ from incompatible pointer type [-Wincompatible-pointer-types]
132 | virtVertex3f(&vrt[vx++], xwid + x, ywid + y, zwid + z);
| ^~~~~~~~~~
| |
| struct vertex_tex *
../src/render.c:25:34: note: expected ‘union uvertex *’ but argument is of type ‘struct vertex_tex *’
25 | void virtVertex3f(union uvertex* vert, float x, float y, float z) {
| ~~~~~~~~~~~~~~~^~~~
../src/render.c:134:30: warning: passing argument 1 of ‘virtVertex3f’ from incompatible pointer type [-Wincompatible-pointer-types]
134 | virtVertex3f(&vrt[vx++], xwid + x, -ywid + y, zwid + z);
| ^~~~~~~~~~
| |
| struct vertex_tex *
../src/render.c:25:34: note: expected ‘union uvertex *’ but argument is of type ‘struct vertex_tex *’
25 | void virtVertex3f(union uvertex* vert, float x, float y, float z) {
| ~~~~~~~~~~~~~~~^~~~
../src/render.c:138:30: warning: passing argument 1 of ‘virtVertex3f’ from incompatible pointer type [-Wincompatible-pointer-types]
138 | virtVertex3f(&vrt[vx++], -xwid + x, -ywid + y, -zwid + z);
| ^~~~~~~~~~
| |
| struct vertex_tex *
../src/render.c:25:34: note: expected ‘union uvertex *’ but argument is of type ‘struct vertex_tex *’
25 | void virtVertex3f(union uvertex* vert, float x, float y, float z) {
| ~~~~~~~~~~~~~~~^~~~
../src/render.c:140:30: warning: passing argument 1 of ‘virtVertex3f’ from incompatible pointer type [-Wincompatible-pointer-types]
140 | virtVertex3f(&vrt[vx++], -xwid + x, -ywid + y, zwid + z);
| ^~~~~~~~~~
| |
| struct vertex_tex *
../src/render.c:25:34: note: expected ‘union uvertex *’ but argument is of type ‘struct vertex_tex *’
25 | void virtVertex3f(union uvertex* vert, float x, float y, float z) {
| ~~~~~~~~~~~~~~~^~~~
../src/render.c:142:30: warning: passing argument 1 of ‘virtVertex3f’ from incompatible pointer type [-Wincompatible-pointer-types]
142 | virtVertex3f(&vrt[vx++], -xwid + x, ywid + y, zwid + z);
| ^~~~~~~~~~
| |
| struct vertex_tex *
../src/render.c:25:34: note: expected ‘union uvertex *’ but argument is of type ‘struct vertex_tex *’
25 | void virtVertex3f(union uvertex* vert, float x, float y, float z) {
| ~~~~~~~~~~~~~~~^~~~
../src/render.c:144:30: warning: passing argument 1 of ‘virtVertex3f’ from incompatible pointer type [-Wincompatible-pointer-types]
144 | virtVertex3f(&vrt[vx++], -xwid + x, ywid + y, -zwid + z);
| ^~~~~~~~~~
| |
| struct vertex_tex *
../src/render.c:25:34: note: expected ‘union uvertex *’ but argument is of type ‘struct vertex_tex *’
25 | void virtVertex3f(union uvertex* vert, float x, float y, float z) {
| ~~~~~~~~~~~~~~~^~~~
../src/render.c: In function ‘createTexCube’:
../src/render.c:155:19: warning: passing argument 1 of ‘createVAO’ from incompatible pointer type [-Wincompatible-pointer-types]
155 | createVAO(vrt, 24, vao, 1, 0, 0);
| ^~~
| |
| struct vertex_tex *
../src/render.c:36:31: note: expected ‘struct vertex *’ but argument is of type ‘struct vertex_tex *’
36 | void createVAO(struct vertex* verticies, size_t count, struct vao* vao, int textures, int overwrite, int vattrib) {
| ~~~~~~~~~~~~~~~^~~~~~~~~
../src/render.c: In function ‘updateChunk’:
../src/render.c:217:87: warning: passing argument 1 of ‘drawBlock’ from incompatible pointer type [-Wincompatible-pointer-types]
217 | if (fm > 0) drawBlock(&vts, &vtsx, &cvts, blk, fm, (float) x, (float) sy, (float) z, chunk->x << 4 | x, y + sy, chunk->z << 4 | z);
| ^~~~
| |
| struct vertex_tex **
In file included from ../src/render.c:20:
../src/block.h:410:27: note: expected ‘uint16_t **’ {aka ‘short unsigned int **’} but argument is of type ‘struct vertex_tex **’
410 | void drawBlock(uint16_t** txd, size_t* txs, size_t* txc, struct vertex_tex** vex, size_t* vexs, size_t* cvec, block blk, unsigned char faceMask, float x, float y, float z, int32_t wx, int32_t wy, int32_t wz);
| ~~~~~~~~~~~^~~
../src/render.c:217:107: warning: passing argument 4 of ‘drawBlock’ makes pointer from integer without a cast [-Wint-conversion]
217 | if (fm > 0) drawBlock(&vts, &vtsx, &cvts, blk, fm, (float) x, (float) sy, (float) z, chunk->x << 4 | x, y + sy, chunk->z << 4 | z);
| ^~~
| |
| block {aka short unsigned int}
In file included from ../src/render.c:20:
../src/block.h:410:78: note: expected ‘struct vertex_tex **’ but argument is of type ‘block’ {aka ‘short unsigned int’}
410 | nt16_t** txd, size_t* txs, size_t* txc, struct vertex_tex** vex, size_t* vexs, size_t* cvec, block blk, unsigned char faceMask, float x, float y, float z, int32_t wx, int32_t wy, int32_t wz);
| ~~~~~~~~~~~~~~~~~~~~^~~
../src/render.c:217:112: warning: passing argument 5 of ‘drawBlock’ makes pointer from integer without a cast [-Wint-conversion]
217 | if (fm > 0) drawBlock(&vts, &vtsx, &cvts, blk, fm, (float) x, (float) sy, (float) z, chunk->x << 4 | x, y + sy, chunk->z << 4 | z);
| ^~
| |
| unsigned char
In file included from ../src/render.c:20:
../src/block.h:410:91: note: expected ‘size_t *’ {aka ‘long unsigned int *’} but argument is of type ‘unsigned char’
410 | size_t* txs, size_t* txc, struct vertex_tex** vex, size_t* vexs, size_t* cvec, block blk, unsigned char faceMask, float x, float y, float z, int32_t wx, int32_t wy, int32_t wz);
| ~~~~~~~~^~~~
../src/render.c:217:116: error: incompatible type for argument 6 of ‘drawBlock’
217 | if (fm > 0) drawBlock(&vts, &vtsx, &cvts, blk, fm, (float) x, (float) sy, (float) z, chunk->x << 4 | x, y + sy, chunk->z << 4 | z);
| ^~~~~~~~~
| |
| float
In file included from ../src/render.c:20:
../src/block.h:410:105: note: expected ‘size_t *’ {aka ‘long unsigned int *’} but argument is of type ‘float’
410 | size_t* txc, struct vertex_tex** vex, size_t* vexs, size_t* cvec, block blk, unsigned char faceMask, float x, float y, float z, int32_t wx, int32_t wy, int32_t wz);
| ~~~~~~~~^~~~
../src/render.c:217:77: error: too few arguments to function ‘drawBlock’
217 | if (fm > 0) drawBlock(&vts, &vtsx, &cvts, blk, fm, (float) x, (float) sy, (float) z, chunk->x << 4 | x, y + sy, chunk->z << 4 | z);
| ^~~~~~~~~
In file included from ../src/render.c:20:
../src/block.h:410:6: note: declared here
410 | void drawBlock(uint16_t** txd, size_t* txs, size_t* txc, struct vertex_tex** vex, size_t* vexs, size_t* cvec, block blk, unsigned char faceMask, float x, float y, float z, int32_t wx, int32_t wy, int32_t wz);
| ^~~~~~~~~
../src/render.c:228:63: error: ‘struct chunk’ has no member named ‘tbufs’
228 | glBindTexture(GL_TEXTURE_BUFFER, chunk->tbufs[i]);
| ^~
../src/render.c:229:25: warning: implicit declaration of function ‘glTexBuffer’; did you mean ‘glReadBuffer’? [-Wimplicit-function-declaration]
229 | glTexBuffer(GL_TEXTURE_BUFFER, GL_RG8UI, chunk->tbufs[i]);
| ^~~~~~~~~~~
| glReadBuffer
../src/render.c:229:71: error: ‘struct chunk’ has no member named ‘tbufs’
229 | glTexBuffer(GL_TEXTURE_BUFFER, GL_RG8UI, chunk->tbufs[i]);
| ^~
../src/render.c:233:43: warning: passing argument 1 of ‘createVAO’ from incompatible pointer type [-Wincompatible-pointer-types]
233 | createVAO(vts, cvts, &chunk->vaos[i], 1, chunk->vaos[i].vao == -1 ? 0 : 1, 0);
| ^~~
| |
| struct vertex_tex *
../src/render.c:36:31: note: expected ‘struct vertex *’ but argument is of type ‘struct vertex_tex *’
36 | void createVAO(struct vertex* verticies, size_t count, struct vao* vao, int textures, int overwrite, int vattrib) {
| ~~~~~~~~~~~~~~~^~~~~~~~~
../src/render.c: In function ‘drawChunk’:
../src/render.c:313:63: error: ‘struct chunk’ has no member named ‘tbufs’
313 | glBindTexture(GL_TEXTURE_BUFFER, chunk->tbufs[i]);
| ^~
../src/render.c:314:71: error: ‘struct chunk’ has no member named ‘tbufs’
314 | glTexBuffer(GL_TEXTURE_BUFFER, GL_RG8UI, chunk->tbufs[i]);
| ^~
../src/render.c: In function ‘drawChar’:
../src/render.c:499:29: warning: array subscript has type ‘char’ [-Wchar-subscripts]
499 | float v6 = fontWidth[c] - .01;
| ^
../src/render.c: In function ‘drawString’:
../src/render.c:524:43: warning: array subscript has type ‘char’ [-Wchar-subscripts]
524 | glTranslatef(fontWidth[str[i]], 0., 0.);
| ~~~^~~
../src/render.c:530:43: warning: array subscript has type ‘char’ [-Wchar-subscripts]
530 | glTranslatef(fontWidth[str[i]], 0., 0.);
| ~~~^~~
../src/render.c: In function ‘stringWidth’:
../src/render.c:540:36: warning: array subscript has type ‘char’ [-Wchar-subscripts]
540 | sx += fontWidth[str[i]];
| ~~~^~~
../src/render.c: In function ‘trimStringToWidth’:
../src/render.c:549:36: warning: array subscript has type ‘char’ [-Wchar-subscripts]
549 | sx += fontWidth[str[i]];
| ~~~^~~
make: *** [src/subdir.mk:59: src/render.o] Error 1