enginmanap / limonEngine

3D FPS game engine with full dynamic lighting and shadows
http://www.limonengine.com
GNU Lesser General Public License v3.0
580 stars 57 forks source link

How to resolve -Werror=cast-function-type? #145

Closed ArshErgon closed 2 years ago

ArshErgon commented 2 years ago

I type this command: $ cd build && make && cp -a ../Data .

[  6%] Building CXX object libs/assimp/code/CMakeFiles/assimp.dir/Common/ZipArchiveIOSystem.cpp.o
/home/arsh/Desktop/openSource/new/limonEngine/libs/assimp/code/Common/ZipArchiveIOSystem.cpp: In static member function ‘static zlib_filefunc_def Assimp::IOSystem2Unzip::get(Assimp::IOSystem*)’:
/home/arsh/Desktop/openSource/new/limonEngine/libs/assimp/code/Common/ZipArchiveIOSystem.cpp:200:42: error: cast between incompatible function types from ‘uLong (*)(voidpf, voidpf, void*, uLong)’ {aka ‘long unsigned int (*)(void*, void*, void*, long unsigned int)’} to ‘read_file_func’ {aka ‘unsigned int (*)(void*, void*, void*, unsigned int)’} [-Werror=cast-function-type]
  200 |     mapping.zread_file = (read_file_func)read;
      |                                          ^~~~
/home/arsh/Desktop/openSource/new/limonEngine/libs/assimp/code/Common/ZipArchiveIOSystem.cpp:201:44: error: cast between incompatible function types from ‘uLong (*)(voidpf, voidpf, const void*, uLong)’ {aka ‘long unsigned int (*)(void*, void*, const void*, long unsigned int)’} to ‘write_file_func’ {aka ‘unsigned int (*)(void*, void*, const void*, unsigned int)’} [-Werror=cast-function-type]
  201 |     mapping.zwrite_file = (write_file_func)write;
      |                                            ^~~~~
/home/arsh/Desktop/openSource/new/limonEngine/libs/assimp/code/Common/ZipArchiveIOSystem.cpp:203:42: error: cast between incompatible function types from ‘long int (*)(voidpf, voidpf, uLong, int)’ {aka ‘long int (*)(void*, void*, long unsigned int, int)’} to ‘seek_file_func’ {aka ‘long int (*)(void*, void*, unsigned int, int)’} [-Werror=cast-function-type]
  203 |     mapping.zseek_file = (seek_file_func)seek;
      |                                          ^~~~
cc1plus: all warnings being treated as errors
make[2]: *** [libs/assimp/code/CMakeFiles/assimp.dir/build.make:193: libs/assimp/code/CMakeFiles/assimp.dir/Common/ZipArchiveIOSystem.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:720: libs/assimp/code/CMakeFiles/assimp.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0

enginmanap commented 2 years ago

that issue was fixed on the upstream, and I updated my fork, but now there is another issue. I will take a look on the weekend.

enginmanap commented 2 years ago

looks like it is fixed now, can you please verify?

enginmanap commented 2 years ago

I am closing the ticket as as far as I can it is fixed, and reporter didn't respond.