【问题标题】:building assimp using MinGW64使用 MinGW64 构建 assimp
【发布时间】:2021-06-06 15:29:48
【问题描述】:

我正在尝试使用 MinGW64 构建 assimp-5.0.0。 CMake CMakeLists.txt -G"MinGW Makefiles" 运行没有问题。 但是当我调用 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 线程,并且创建者说它已修复...但似乎并非如此。 关于如何修复它的任何想法?

【问题讨论】:

    标签: mingw-w64 assimp


    【解决方案1】:

    很抱歉给您带来不便。我认为这个问题已经被另一个提交修复了。我已重新打开问题报告。

    【讨论】:

      【解决方案2】:

      在使用 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
      

      【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-04-15
      • 2021-04-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多