linux -/usr/bin/ld : cannot open output file assimp2json: Is a directory

标签 linux gcc makefile cmake assimp

经过一些修改后构建 assimp 工作正常,但 Readme.md 中关于构建 assimp2json 的内容非常不清楚。 从 github dot com/assimp/assimp2json 构建时,会产生错误“/usr/bin/ld:无法打开输出文件 assimp2json:是一个目录”。 在网上搜索这个问题时,发现用其他软件删除冲突的目录是可以的,但是这里不是这样,内容是必需的。 同样重命名文件系统上的目录和 CMakeLists.txt 中对目录的引用也没有用,因为它导致输出文件名更改为新目录名的名称。 在 make 手册中我找不到更改输出路径的选项。在网上搜索了更多之后,我感到卡住了。

围绕错误的更少 sussinct 输出:“

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

”。

还尝试了 github dot com/assimp/assimp/blob/master/INSTALL 中所述的“cmake CMakeLists.txt -G 'Unix Makefiles'”,但无济于事。

由于 github dot com/assimp/assimp2json 是从 github dot com/acgessler/assimp2json 派生出来的,它有最近的提交(2013 年与 2015 年),我也尝试使用相同的命令构建它。 并将 assimp/cmake-modules/AddGTest.cmake 的第 34 行从“GIT_REPOSITORY chromium.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

”。

是否有其他人能够构建它并愿意分享技巧?或者其他人没有,我应该看看其他软件吗?将不胜感激。

最佳答案

assimp2json:使用正确的命令在这里构建 OK .... [100%] 构建目标 assimp2json

git clone https://github.com/assimp/assimp2json.git
cd assimp2json/
git submodule init
git submodule update
mkdir build
cd build/
cmake ../
make

即大多数“cmake builds”将需要一个 build/文件夹。 并且:可能是您对三年前的代码使用了太晚的 g++。建议:CXX=g++-4.9 cmake ../ ... 还有其他问题吗?然后请用您的操作系统名称和版本更新您的帖子。

关于linux -/usr/bin/ld : cannot open output file assimp2json: Is a directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38146949/

相关文章:

php - 检索当前用户的 linux 密码

java - 无法使用 Java 9 启动 solr

linux - 如何在shell脚本中递归使用粘贴命令

c - 段错误核心转储 gcc 代码块

c - 如何在 microblaze 中为固定地址编译库

java - 用于 Java 的 MakeFile?

c - 如何在 makefile 的 while 循环中更改变量的值?

ubuntu - 在 MAKEFLAGS 中设置 -j8 是否会导致递归 make 出现问题?

iphone - 与外部设备的蓝牙通信

c++ - 错误读取变量 : Could not find the frame base