Hi all
I am trying to compile this little game
https://github.com/landersson/roketz3dIt was written for SDL1.2, now I migrated them to SDL2
However when I try to compile it, I get these errors
compiling with g++ or adding
#include <cstring> to source code
does not work..
Sinan@LENOVO /amiga/roketz3d
$ ppc-amigaos-gcc -athread=native *.cc -o roketz.3d -lGL -lGLU -lSDL2 -lSDL2_mixer -lSDL2_image -lplib -ljpeg -lpng -lz -lm -lc -lpthread -lstdc++
test_png.cc: In function ‘void png_mem_write_data(png_structp, png_bytep, png_size_t)’:
test_png.cc:31:5: error: ‘memcpy’ was not declared in this scope
31 | memcpy(buf->buffer + buf->offset, data, length);
| ^~~~~~
test_png.cc:11:1: note: ‘memcpy’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’?
10 | #include <zlib.h>
+++ |+#include <cstring>
11 |
test_png.cc: In function ‘int compress_png(unsigned char**, int, int, uint8_t*, int)’:
test_png.cc:63:5: error: ‘memset’ was not declared in this scope
63 | memset(&png_buf, 0, sizeof(png_buf));
| ^~~~~~
test_png.cc:63:5: note: ‘memset’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’?
test_png.cc: In function ‘int main()’:
test_png.cc:125:5: error: ‘memset’ was not declared in this scope
125 | memset(data, 0, width * height * 3);
| ^~~~~~
test_png.cc:125:5: note: ‘memset’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’?
threads.cc: In constructor ‘ImageData::ImageData(uint8_t*, int, int)’:
threads.cc:18:62: error: class ‘ImageData’ does not have any field named ‘_size’
18 | ImageData(uint8_t *data, int wid, int id) : _data(data), _size(size), _id(id) { }
| ^~~~~
threads.cc:18:68: error: ‘size’ was not declared in this scope
18 | ImageData(uint8_t *data, int wid, int id) : _data(data), _size(size), _id(id) { }
| ^~~~
threads.cc: In function ‘int jpeg_writer_thread(int)’:
threads.cc:46:1: warning: no return statement in function returning non-void [-Wreturn-type]
46 | }
| ^