I am trying to build Assimp with Code::Blocks and MinGW as a static library. I have downloaded the latest available version (5.0.1) and created a makefile for Code::Blocks using cmake-gui. I am able to open that file with Code::Blocks, but when I am trying to build it fails. Here is the complete log:
-------------- Build: all in Assimp (compiler: GNU GCC Compiler)---------------
Checking if target is up-to-date: mingw32-make.exe -q -f Makefile all
Running command: C:/PROGRA~2/CODEBL~1/MinGW/bin/mingw32-make.exe -f "C:/Users/.../assimp-5.0.1/build/Makefile" VERBOSE=1 all
"C:\Users\...\cmake-3.22.1-windows-i386\bin\cmake.exe" -S"C:\Users\...\assimp-5.0.1" -B"C:\Users\...\assimp-5.0.1\build" --check-build-system CMakeFiles\Makefile.cmake 0
Re-run cmake file: Makefile older than: C:/Users/.../cmake-3.22.1-windows-i386/share/cmake-3.22/Modules/CMakeCInformation.cmake
-- Shared libraries disabled
-- Looking for DirectX...
-- DirectX_PREFIX_PATH changed.
-- Found DirectX: C:/Program Files (x86)/CodeBlocks/MinGW/lib/libd3d9.a
-- DX lib dir: C:/Program Files (x86)/CodeBlocks/MinGW/lib
-- Looking for ZLIB...
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
-- Could not locate ZLIB
-- compiling zlib from sources
CMake Deprecation Warning at contrib/zlib/CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
CMake Warning (dev) at C:/Users/.../cmake-3.22.1-windows-i386/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
The package name passed to `find_package_handle_standard_args` (rt) does
not match the name of the calling package (RT). This can lead to problems
in calling code that expects `find_package` result variables (e.g.,
`_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
cmake-modules/FindRT.cmake:19 (find_package_handle_standard_args)
code/CMakeLists.txt:1013 (FIND_PACKAGE)
This warning is for project developers. Use -Wno-dev to suppress it.
INFO Hunter enabled or RT-extension not found. glTF import/export will be built without Open3DGC-compression.
-- Could NOT find rt (missing: RT_LIBRARY)
-- Enabled importer formats: AMF 3DS AC ASE ASSBIN B3D BVH COLLADA DXF CSM HMP IRRMESH IRR LWO LWS MD2 MD3 MD5 MDC MDL NFF NDO OFF OBJ OGRE OPENGEX PLY MS3D COB BLEND IFC XGL FBX Q3D Q3BSP RAW SIB SMD STL TERRAGEN 3D X X3D GLTF 3MF MMD STEP
-- Disabled importer formats:
-- Enabled exporter formats: 3DS ASSBIN ASSXML COLLADA OBJ OPENGEX PLY FBX STL X X3D GLTF 3MF ASSJSON STEP
-- Disabled exporter formats:
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/.../assimp-5.0.1/build
"C:\Users\...\cmake-3.22.1-windows-i386\bin\cmake.exe" -E cmake_progress_start "C:\Users\...\assimp-5.0.1\build\CMakeFiles" "C:\Users\...\assimp-5.0.1\build\\CMakeFiles\progress.marks"
C:/PROGRA~2/CODEBL~1/MinGW/bin/mingw32-make.exe -f CMakeFiles\Makefile2 all
mingw32-make.exe[1]: Entering directory 'C:/Users/.../assimp-5.0.1/build'
C:/PROGRA~2/CODEBL~1/MinGW/bin/mingw32-make.exe -f contrib\zlib\CMakeFiles\zlib.dir\build.make contrib/zlib/CMakeFiles/zlib.dir/depend
mingw32-make.exe[2]: Entering directory 'C:/Users/.../assimp-5.0.1/build'
[ 1%] Generating zlib1rc.obj
cd /d C:\Users\...\ASSIMP~1.1\build\contrib\zlib && "C:\Program Files (x86)\CodeBlocks\MinGW\bin\windres.exe" -D GCC_WINDRES -I "C:/Users/.../assimp-5.0.1/contrib/zlib" -I "C:/Users/.../assimp-5.0.1/build/contrib/zlib" -o "C:/Users/.../assimp-5.0.1/build/contrib/zlib/zlib1rc.obj" -i "C:/Users/.../assimp-5.0.1/contrib/zlib/win32/zlib1.rc"
Der Befehl "C:\Program" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
C:\Program Files (x86)\CodeBlocks\MinGW\bin\windres.exe: preprocessing failed.
mingw32-make.exe[2]: *** [contrib/zlib/zlib1rc.obj] Error 1
mingw32-make.exe[1]: *** [contrib/zlib/CMakeFiles/zlib.dir/all] Error 2
mingw32-make.exe: *** [all] Error 2
contrib\zlib\CMakeFiles\zlib.dir\build.make:72: recipe for target 'contrib/zlib/zlib1rc.obj' failed
mingw32-make.exe[2]: Leaving directory 'C:/Users/.../assimp-5.0.1/build'
CMakeFiles\Makefile2:176: recipe for target 'contrib/zlib/CMakeFiles/zlib.dir/all' failed
mingw32-make.exe[1]: Leaving directory 'C:/Users/.../assimp-5.0.1/build'
C:/Users/.../assimp-5.0.1/build/Makefile:134: recipe for target 'all' failed
Process terminated with status 2 (0 minute(s), 11 second(s))
4 error(s), 0 warning(s) (0 minute(s), 11 second(s))
I am not really familiar with all that build stuff, but it looks like there is some problem with zlib. How can I fix that problem and build the library with the compiler I have?
I don’t want to switch to MSYS2.
After I switched to Assimp version 5.1.6, it became even worth it. CMake is not able to generate the makefile:
Possibly this could be the reason:
But I don't have any idea about all that makefile stuff.
I even moved to version 3.0, which still not working with CMake. At least that version has a way around that annoying CMake. There is a Visual Studio project which I was able to open and select the noboost version like this:
But even with that selection, I got many errors about Boost. But there are some error messages not related to Boost which make no sense for me:
C:\...\assimp--3.0.1270-source-only\code\StringComparison.h||In function 'int Assimp::ASSIMP_stricmp(const char*, const char*)':|
C:\...\assimp--3.0.1270-source-only\code\StringComparison.h|137|error: '::strcasecmp' has not been declared|
C:\...\assimp--3.0.1270-source-only\code\StringComparison.h||In function 'int Assimp::ASSIMP_strincmp(const char*, const char*, unsigned int)':|
C:\...\assimp--3.0.1270-source-only\code\StringComparison.h|186|error: '::strncasecmp' has not been declared|
Both strcasecmp and strncasecmp are from string.h, but including string.h didn’t change anything.
As can be seen here, I am not the only one with this problem. So the solutions from that question worked for strcasecmp and strncasecmp, but there are still a lot of errors because of that annoying Boost.