编译出错了
cmake -S .. -B . -DCMAKE_BUILD_TYPE=Debug
CMake Warning at /opt/homebrew/Cellar/cmake/3.30.1/share/cmake/Modules/Platform/Darwin-Initialize.cmake:311 (message):
Ignoring CMAKE_OSX_SYSROOT value:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk
because the directory does not exist.
Call Stack (most recent call first):
/opt/homebrew/Cellar/cmake/3.30.1/share/cmake/Modules/CMakeSystemSpecificInitialize.cmake:34 (include)
CMakeLists.txt:2 (project)
Current build type: Debug
-- Using Cocoa for window creation
-- {fmt} version: 11.0.2
-- Build type: Debug
-- Shared libraries disabled
-- compiling zlib from sources
INFO Hunter enabled or RT-extension not found. glTF import/export will be built without Open3DGC-compression.
-- Enabled importer formats: COLLADA OBJ FBX
-- Disabled importer formats: AMF 3DS AC ASE ASSBIN B3D BVH DXF CSM HMP IRRMESH IQM IRR LWO LWS M3D MD2 MD3 MD5 MDC MDL NFF NDO OFF OGRE OPENGEX PLY MS3D COB BLEND IFC XGL Q3D Q3BSP RAW SIB SMD STL TERRAGEN 3D X X3D GLTF 3MF MMD
-- Enabled exporter formats:
-- Disabled exporter formats: OBJ OPENGEX PLY 3DS ASSBIN ASSXML M3D COLLADA FBX STL X X3D GLTF 3MF PBRT ASSJSON STEP
-- Treating all warnings as errors (for assimp library only)
-- Configuring done (0.1s)
-- Generating done (0.1s)
-- Build files have been written to: /Users/zilong/coding/graphics/dandelion/build
❯ cmake --build . --parallel 8
[ 0%] Building CXX object deps/fmt/CMakeFiles/fmt.dir/src/os.cc.o
[ 1%] Building CXX object deps/fmt/CMakeFiles/fmt.dir/src/format.cc.o
[ 1%] Building C object deps/assimp/contrib/zlib/CMakeFiles/zlibstatic.dir/crc32.c.o
[ 1%] Building C object deps/assimp/contrib/zlib/CMakeFiles/zlibstatic.dir/gzclose.c.o
[ 2%] Building C object deps/assimp/contrib/zlib/CMakeFiles/zlibstatic.dir/adler32.c.o
[ 2%] Building C object deps/assimp/contrib/zlib/CMakeFiles/zlibstatic.dir/compress.c.o
[ 3%] Building C object deps/assimp/contrib/zlib/CMakeFiles/zlibstatic.dir/deflate.c.o
[ 4%] Building C object deps/glfw/src/CMakeFiles/glfw.dir/context.c.o
In file included from /Users/zilong/coding/graphics/dandelion/deps/assimp/contrib/zlib/gzclose.c:6:
/Users/zilong/coding/graphics/dandelion/deps/assimp/contrib/zlib/gzguts.h:21:10: fatal error: 'stdio.h' file not found
21 | #include <stdio.h>
| ^~~~~~~~~
In file included from /Users/zilong/coding/graphics/dandelion/deps/fmt/src/format.cc:8:
/Users/zilong/coding/graphics/dandelion/deps/fmt/include/fmt/format-inl.h:12:12: fatal error: 'algorithm' file not found
12 | # include <algorithm>
| ^~~~~~~~~~~
In file included from /Users/zilong/coding/graphics/dandelion/deps/fmt/src/os.cc:13:
In file included from /Users/zilong/coding/graphics/dandelion/deps/fmt/include/fmt/os.h:11:
In file included from /Users/zilong/coding/graphics/dandelion/deps/fmt/include/fmt/format.h:41:
/Users/zilong/coding/graphics/dandelion/deps/fmt/include/fmt/base.h:17:12: fatal error: 'stdio.h' file not found
17 | # include <stdio.h> // FILE
| ^~~~~~~~~
In file included from /Users/zilong/coding/graphics/dandelion/deps/assimp/contrib/zlib/crc32.c:31:
In file included from /Users/zilong/coding/graphics/dandelion/deps/assimp/contrib/zlib/zutil.h:22:
In file included from /Users/zilong/coding/graphics/dandelion/deps/assimp/contrib/zlib/zlib.h:34:
In file included from /Users/zilong/coding/graphics/dandelion/deps/assimp/contrib/zlib/adler32.c:8:
In file included from /Users/zilong/coding/graphics/dandelion/deps/assimp/contrib/zlib/zutil.h:22:
In file included from /Users/zilong/coding/graphics/dandelion/deps/assimp/contrib/zlib/zlib.h:34:
/Users/zilong/coding/graphics/dandelion/build/deps/assimp/contrib/zlib/zconf.h:In file included from /Users/zilong/coding/graphics/dandelion/deps/assimp/contrib/zlib/compress.c:9In file included from :
In file included from /Users/zilong/coding/graphics/dandelion/deps/assimp/contrib/zlib/zlib.h/Users/zilong/coding/graphics/dandelion/deps/assimp/contrib/zlib/deflate.c::3452:
:
In file included from /Users/zilong/coding/graphics/dandelion/build/deps/assimp/contrib/zlib/zconf.h446/Users/zilong/coding/graphics/dandelion/build/deps/assimp/contrib/zlib/zconf.h/Users/zilong/coding/graphics/dandelion/deps/assimp/contrib/zlib/deflate.h:446::::141644614:::
In file included from /Users/zilong/coding/graphics/dandelion/deps/assimp/contrib/zlib/zutil.h:fatal error: 22:
fatal error: 'sys/types.h' file not found
In file included from /Users/zilong/coding/graphics/dandelion/deps/assimp/contrib/zlib/zlib.h:34:
:/Users/zilong/coding/graphics/dandelion/build/deps/assimp/contrib/zlib/zconf.h:446:14: fatal error: 446 | # 14: fatal error: 'sys/types.h' file not foundin
'sys/types.h' file not foundclu 446 | de <sys/ty'sys/types.h' file not found#
pes.h> 446 | # 446 / * | f#o in c rl uoidfne <sys/tcylpes.h> i n c l u/d*e f<osrysf/_t *ud et /y
p e| ofsf<.shy>_s t / * ^~~~~~~~~~~~~/
| ^~~~~~~~~~~~~
t ype/s.h> /** f ofro ro foff_ft_ t* /*/
| | ^~~~~~~~~~~~~
^~~~~~~~~~~~~
In file included from /Users/zilong/coding/graphics/dandelion/deps/glfw/src/context.c:30:
In file included from /Users/zilong/coding/graphics/dandelion/deps/glfw/src/internal.h:184:
/Users/zilong/coding/graphics/dandelion/deps/glfw/src/cocoa_platform.h:28:10: fatal error: 'dlfcn.h' file not found
28 | #include <dlfcn.h>
| ^~~~~~~~~
1111 error generated error error generated generated.
error generated.
.
.
1 error generated.
1 error generated.
make[2]: *** [deps/assimp/contrib/zlib/CMakeFiles/zlibstatic.dir/deflate.c.o] Error 1
make[2]: *** [deps/glfw/src/CMakeFiles/glfw.dir/context.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [deps/assimp/contrib/zlib/CMakeFiles/zlibstatic.dir/crc32.c.o] Error 1
make[2]: *** [deps/assimp/contrib/zlib/CMakeFiles/zlibstatic.dir/adler32.c.o] Error 1
make[2]: *** [deps/assimp/contrib/zlib/CMakeFiles/zlibstatic.dir/gzclose.c.o] Error 1
make[2]: *** [deps/assimp/contrib/zlib/CMakeFiles/zlibstatic.dir/compress.c.o] Error 1
make[1]: *** [deps/assimp/contrib/zlib/CMakeFiles/zlibstatic.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [deps/glfw/src/CMakeFiles/glfw.dir/all] Error 2
1 error generated.
make[2]: *** [deps/fmt/CMakeFiles/fmt.dir/src/os.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
1 error generated.
make[2]: *** [deps/fmt/CMakeFiles/fmt.dir/src/format.cc.o] Error 1
make[1]: *** [deps/fmt/CMakeFiles/fmt.dir/all] Error 2
make: *** [all] Error 2
求助一下,最新的仓库,这个报错是什么意思呢?
我把上述 bug 解决了原来的问题又出现了‘dandelion-ray’not found `
[ 96%] Building CXX object CMakeFiles/dandelion.dir/deps/imgui/imgui_draw.cpp.o
[ 97%] Building CXX object CMakeFiles/dandelion.dir/deps/imgui/imgui_tables.cpp.o
[ 98%] Building CXX object CMakeFiles/dandelion.dir/deps/imgui/imgui_widgets.cpp.o
[ 98%] Building CXX object CMakeFiles/dandelion.dir/deps/imgui/imgui_impl_glfw.cpp.o
[100%] Building CXX object CMakeFiles/dandelion.dir/deps/imgui/imgui_impl_opengl3.cpp.o
[100%] Linking CXX executable dandelion
ld: library ‘dandelion-ray’ not found
c++: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [dandelion] Error 1
make[1]: *** [CMakeFiles/dandelion.dir/all] Error 2
make: *** [all] Error 2
请问这个 library 在哪找,装到哪里?
如果你想要使用这个静态库,请到仓库 Release 中下载符合自己操作系统、编译器的版本。带有 -debug
后缀的库用于 Debug 模式,不带此后缀的用于 Release 模式。相应的链接指令在 CMakeLists.txt 中已经写好,将四个文件都放置于 deps 目录下即可通过编译。
首先,今年用的版本还没有发布,请稍等几天;其次,看文档切忌一目十行,你显然没有从头认真看构建说明。