简体   繁体   English

使用 MinGW 构建 ASSIMP 导致文件过大错误

[英]Building ASSIMP with MinGW causes file too big error

I am building ASSIMP using cmake and mingw-w64 on windows 10 and it gives me "file too big" errors while creating the object code.我正在 Windows 10 上使用 cmake 和 mingw-w64 构建 ASSIMP,它在创建目标代码时给了我“文件太大”错误。 I tried using MinGW and MinGW-w64 and both give me the same error.我尝试使用 MinGW 和 MinGW-w64,但都给我同样的错误。 I am using the default settings, I configure the project with cmake, generate the makefile and then run mingw32-make.我使用默认设置,我用cmake配置项目,生成makefile,然后运行mingw32-make。 Is there some kind of flag I can set to fix this?我可以设置某种标志来解决这个问题吗?

Compiler:编译器:

g++ (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0

Here is the output:这是输出:

[ 59%] Building CXX object code/CMakeFiles/assimp.dir/Importer/StepFile/StepFileImporter.cpp.obj
[ 60%] Building CXX object code/CMakeFiles/assimp.dir/Importer/StepFile/StepFileGen1.cpp.obj
C:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/as.exe: 
CMakeFiles\assimp.dir\Importer\StepFile\StepFileGen1.cpp.obj: section .xdata$_ZNSt10_Head_baseILy0EPN6Assimp8StepFile29directed_dimensional_locationELb0EE7_M_headERKS4_: 
string table overflow at offset 10000029
C:\Users\ANDREW~1.NOT\AppData\Local\Temp\ccwwseVM.s: Assembler messages:
C:\Users\ANDREW~1.NOT\AppData\Local\Temp\ccwwseVM.s: Fatal error: can't close CMakeFiles\assimp.dir\Importer\StepFile\StepFileGen1.cpp.obj: File too big
mingw32-make[2]: *** [code\CMakeFiles\assimp.dir\build.make:2485: code/CMakeFiles/assimp.dir/Importer/StepFile/StepFileGen1.cpp.obj] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:274: code/CMakeFiles/assimp.dir/all] Error 2
mingw32-make: *** [Makefile:129: all] Error 2

EDIT: I was using the master branch of Assimp from github, which has newer experimental features.编辑:我使用了来自 github 的 Assimp 的 master 分支,它具有更新的实验功能。 I downloaded an older release version and I did not get the same errors.我下载了较旧的发行版,但没有遇到相同的错误。

此错误由assimp 本身修复https://github.com/assimp/assimp/issues/2406您使用哪个版本?

What worked for me :什么对我有用:
Go into the CMakeLists.txt and add:进入 CMakeLists.txt 并添加:

set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-O3")

Then compile with some options off:然后在关闭一些选项的情况下进行编译:

cmake .. -G "Unix Makefiles" -DASSIMP_BUILD_ASSIMP_TOOLS=OFF -DASSIMP_BUILD_TESTS=OFF
make -j4 && make install

It worked for 5.0.0-rc1 and 5.0.1 too.它也适用于 5.0.0-rc1 和 5.0.1。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM