0

I'm trying to compile assimp using MinGW. I run the commands

cmake CMakeLists.txt -G "MinGW Makefiles" -Wno-error
cmake --build .

but when the project builds I still get an error and the build fails. The error:

In file included from C:\godijustwantittowork\include\assimp-5.2.3\contrib\unzip\ioapi.c:22:
C:\godijustwantittowork\include\assimp-5.2.3\contrib\unzip\ioapi.c: In function 'ftell64_file_func':
C:\godijustwantittowork\include\assimp-5.2.3\contrib\unzip\ioapi.h:39:21: error: implicit declaration of function 'ftello'; did you mean 'ftell'? [-Werror=implicit-function-declaration]
   39 | #   define ftello64 ftello
      |                     ^~~~~~
C:\godijustwantittowork\include\assimp-5.2.3\contrib\unzip\ioapi.c:245:11: note: in expansion of macro 'ftello64'
  245 |     ret = ftello64(ioposix->file);
      |           ^~~~~~~~
C:\godijustwantittowork\include\assimp-5.2.3\contrib\unzip\ioapi.c: In function 'fseek64_file_func':
C:\godijustwantittowork\include\assimp-5.2.3\contrib\unzip\ioapi.h:40:21: error: implicit declaration of function 'fseeko'; did you mean 'fseek'? [-Werror=implicit-function-declaration]
   40 | #   define fseeko64 fseeko
      |                     ^~~~~~
C:\godijustwantittowork\include\assimp-5.2.3\contrib\unzip\ioapi.c:303:9: note: in expansion of macro 'fseeko64'
  303 |     if (fseeko64(ioposix->file, offset, fseek_origin) != 0)
      |         ^~~~~~~~
cc1.exe: all warnings being treated as errors
code\CMakeFiles\assimp.dir\build.make:3049: recipe for target 'code/CMakeFiles/assimp.dir/__/contrib/unzip/ioapi.c.obj' failed
mingw32-make.exe[2]: *** [code/CMakeFiles/assimp.dir/__/contrib/unzip/ioapi.c.obj] Error 1
CMakeFiles\Makefile2:249: recipe for target 'code/CMakeFiles/assimp.dir/all' failed
mingw32-make.exe[1]: *** [code/CMakeFiles/assimp.dir/all] Error 2
Makefile:147: recipe for target 'all' failed
mingw32-make.exe: *** [all] Error 2

Couldn't find an answer on here so sorry if this is a duplicate.

  • Ignoring "implicit declaration of function" errors has a little sense because it almost never passes the linking stage. You are better to ask why assimp is not built in the first place. – Tsyvarev May 04 '22 at 09:33

1 Answers1

0

Passing -Wno-error to cmake doesn't magically cause CMake to pass that flag to any and all compilers for any and all languages.

To pass a flag to the C compiler, put CFLAGS=-Wno-error on your CMake command line. See e.g. this answer. You may need to clear your CMake cache.

Also note that this is unlikely to help you, because suppressing the implicit declaration warning still doesn't make those ftello and fseeko functions available.

Thomas
  • 174,939
  • 50
  • 355
  • 478
  • yes you are right about the functions not being available. I had to change the source a little. However, warnings occured later down in compiling so your help was still invaluable. – confused cmake user May 04 '22 at 08:31