我正在尝试使用MinGW64构建assimp-5.0.0。CMake CMakeLists.txt -G"MinGW Makefile“运行时没有问题。但是,当我调用mingw32-make时,我在
[ 73%] Linking CXX executable ..\..\bin\assimp.exe:
CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text+0x8d): undefined reference to Assimp::Importer::ValidateFlags(unsigned int) const
CMakeFiles\assimp_cmd.dir/objects.a(Main.cpp.obj):Main.cpp:(.text+0xc4): undefined reference to Assimp::Importer::ReadFile(char const*, unsigned int)
...
CMakeFiles\assimp_cmd.dir/objects.a(Export.cpp.obj):Export.cpp:(.text+0xf44): undefined reference to `Assimp::Exporter::GetExportFormatDescription(unsigned long long) const'
collect2.exe: error: ld returned 1 exit status
mingw32-make[2]: *** [tools\assimp_cmd\CMakeFiles\assimp_cmd.dir\build.make:195: bin/assimp.exe] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:337: tools/assimp_cmd/CMakeFiles/assimp_cmd.dir/all] Error 2
mingw32-make: *** [Makefile:135: all] Error 2我在https://github.com/assimp/assimp/issues/2431找到了一个github线程,同样的问题,创建者说它已经修复了……但看起来并非如此。有没有办法解决这个问题?
发布于 2021-06-10 21:17:42
当使用MinGW-w64构建assimp 5.0.1时,我注意到有一些dllexport/dllimport问题。
在我的例子中,它们是通过这个补丁解决的:
patch -ulbf include/assimp/defs.h << EOF
@@ -128,3 +128,3 @@
-#ifdef _MSC_VER
+#ifdef _WIN32
# undef ASSIMP_API
EOF发布于 2021-06-07 14:15:48
很抱歉给您带来不便。我以为这个问题已经被另一个提交解决了。我已重新打开问题报告。
https://stackoverflow.com/questions/67860801
复制相似问题