建筑辅助在经过一些修补之后工作正常,但Readme.md对于构建assimp2json还不是很清楚。 当从github dot com / assimp / assimp2json构建时,错误" / usr / bin / ld:无法打开输出文件assimp2json:是一个目录"被生产。 在网上搜索这个问题时,我发现使用其他软件可以删除冲突的目录,但这不是这种情况,内容是必需的。 同时重命名文件系统上的目录和CMakeLists.txt中对dir的引用也不起作用,因为它导致输出文件名更改为新目录名的名称。 在make手册中,我找不到更改输出路径的选项。在搜索网页之后,我感觉更加困难了。
错误周围的输出较少:"
Linking CXX shared library ../../lib/libassimp.so
[ 97%] Built target assimp
Scanning dependencies of target assimp2json
[ 98%] Building CXX object CMakeFiles/assimp2json.dir/assimp2json/main.cpp.o
[ 98%] Building CXX object CMakeFiles/assimp2json.dir/assimp2json/json_exporter.cpp.o
[ 99%] Building C object CMakeFiles/assimp2json.dir/assimp2json/cencode.c.o
[100%] Building CXX object CMakeFiles/assimp2json.dir/assimp2json/mesh_splitter.cpp.o
Linking CXX executable assimp2json
/usr/bin/ld: cannot open output file assimp2json: Is a directory
collect2: error: ld returned 1 exit status
CMakeFiles/assimp2json.dir/build.make:162: recipe for target 'assimp2json' failed
make[2]: *** [assimp2json] Error 1
CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/assimp2json.dir/all' failed
make[1]: *** [CMakeFiles/assimp2json.dir/all] Error 2
Makefile:117: recipe for target 'all' failed
make: *** [all] Error 2
"
我用来构建的命令:"
git clone https://github.com/assimp/assimp2json
cd assimp2json
git submodule init
git submodule update
cmake CMakeLists.txt
make
"
还试过" cmake CMakeLists.txt -G' Unix Makefiles'"如github dot com / assimp / assimp / blob / master / INSTALL中所述,无济于事。
由于github dot com / assimp / assimp2json是从github dot com / acgessler / assimp2json派生的,它有更多的近期提交(2013年与2015年),我也尝试使用相同的命令构建它。 并更改了" GIT_REPOSITORY中的assimp / cmake-modules / AddGTest.cmake第34行chrome.googlesource dot com / external / googletest"到" GIT_REPOSITORY github dot com / google / googletest /"。
这取得了一些进展,但还不够:"
Linking CXX shared library ../../lib/libassimp.so
[ 80%] Built target assimp
Scanning dependencies of target assimp2json
[ 80%] Building CXX object CMakeFiles/assimp2json.dir/assimp2json/main.cpp.o
[ 81%] Building CXX object CMakeFiles/assimp2json.dir/assimp2json/json_exporter.cpp.o
[ 81%] Building C object CMakeFiles/assimp2json.dir/assimp2json/cencode.c.o
[ 82%] Building CXX object CMakeFiles/assimp2json.dir/assimp2json/mesh_splitter.cpp.o
Linking CXX executable bin/assimp2json
[ 82%] Built target assimp2json
Scanning dependencies of target gtest
[ 82%] Creating directories for 'gtest'
[ 83%] Performing download step (git clone) for 'gtest'
-- gtest download command succeeded. See also /opt/assimp2json/assimp/test/gtest/src/gtest-stamp/gtest-download-*.log
[ 84%] No patch step for 'gtest'
[ 84%] Performing update step for 'gtest'
Already on 'master'
Your branch is up-to-date with 'origin/master'.
[ 84%] Performing configure step for 'gtest'
-- gtest configure command succeeded. See also /opt/assimp2json/assimp/test/gtest/src/gtest-stamp/gtest-configure-*.log
[ 85%] Performing build step for 'gtest'
-- gtest build command succeeded. See also /opt/assimp2json/assimp/test/gtest/src/gtest-stamp/gtest-build-*.log
[ 86%] No install step for 'gtest'
[ 86%] Completed 'gtest'
[ 86%] Built target gtest
Scanning dependencies of target unit
[ 86%] Building C object assimp/test/CMakeFiles/unit.dir/unit/CCompilerTest.c.o
[ 87%] Building CXX object assimp/test/CMakeFiles/unit.dir/unit/Main.cpp.o
In file included from /opt/assimp2json/assimp/test/unit/Main.cpp:1:0:
/opt/assimp2json/assimp/test/unit/UnitTestPCH.h:11:25: fatal error: gtest/gtest.h: No such file or directory
#include <gtest/gtest.h>
^
compilation terminated.
assimp/test/CMakeFiles/unit.dir/build.make:77: recipe for target 'assimp/test/CMakeFiles/unit.dir/unit/Main.cpp.o' failed
make[2]: *** [assimp/test/CMakeFiles/unit.dir/unit/Main.cpp.o] Error 1
CMakeFiles/Makefile2:250: recipe for target 'assimp/test/CMakeFiles/unit.dir/all' failed
make[1]: *** [assimp/test/CMakeFiles/unit.dir/all] Error 2
Makefile:117: recipe for target 'all' failed
make: *** [all] Error 2
&#34;
其他人是否能够建立这个并愿意分享这个技巧?或者其他人是否失败,我应该看看其他软件吗?将不胜感激。
答案 0 :(得分:0)
assimp2json:使用正确的命令在这里构建好.... [100%]建立目标assimp2json
git clone https://github.com/assimp/assimp2json.git
cd assimp2json/
git submodule init
git submodule update
mkdir build
cd build/
cmake ../
make
即。最多&#34; cmake build&#34;将需要一个构建/文件夹。
并且:可能是你使用了太晚的g ++用于三年前的代码。建议:CXX=g++-4.9 cmake ../
......还有什么问题吗?然后请使用您的操作系统名称和版本更新您的帖子。