簡體   English   中英

使用 Code::Blocks 和 MinGW 構建 Assimp

[英]Building Assimp with Code::Blocks and MinGW

我正在嘗試使用Code::BlocksMinGW構建 Assimp 作為 static 庫。 我已經下載了最新的可用版本 (5.0.1) 並使用 cmake-gui 為 Code::Blocks 創建了 makefile。 我可以使用 Code::Blocks 打開該文件,但是當我嘗試構建它時會失敗。 這是完整的日志:

-------------- 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))

我對所有構建的東西都不是很熟悉,但看起來 zlib 有一些問題。 如何解決該問題並使用我擁有的編譯器構建庫?

我不想切換到 msys2。

目前最新的 assimp 版本是5.1.6 ,所以看起來你有點落后了。

該版本使用 MinGW-w64 構建。 我使用 CMake 和 Ninja 構建它。 I use the following CMake flags: -DASSIMP_BUILD_ASSIMP_TOOLS:BOOL=ON -DASSIMP_HEADERCHECK:BOOL=OFF -DASSIMP_OPT_BUILD_PACKAGES:BOOL=OFF -DSYSTEM_IRRXML:BOOL=OFF -DASSIMP_BUILD_SAMPLES:BOOL=OFF -DBUILD_DOCS:BOOL=OFF -DASSIMP_BUILD_TESTS:BOOL=OFF -DCMAKE_CXX_FLAGS:STRING="-Wno-array-bounds -Wno-alloc-size-larger-than -Wno-error=array-compare"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM