qt mingw编译vtk,File too big/too many sections
时间: 2024-01-04 16:02:54 浏览: 27
这个问题可能是由于使用的MinGW版本不兼容VTK库所导致的。建议尝试以下操作:
1. 检查MinGW版本是否与VTK库兼容。可以尝试使用与VTK库相同的MinGW版本进行编译。
2. 尝试在编译时使用以下选项:
```
-Wl,--large-address-aware
```
该选项会将可执行文件的地址空间扩大到4GB,这可能会解决文件过大的问题。
3. 如果仍然无法解决问题,可以尝试使用其他编译器,例如MSVC或Clang。
希望这些方法能够帮助您解决问题。
相关问题
qt5.12.12 minGw64 File too big too many sections (83249)
这个问题可能是由于使用的MinGW编译器版本太老,无法处理较大的目标文件而导致的。可以尝试升级MinGW编译器版本,或者使用其他编译器,例如Visual C++等。
另外,也可以在编译Qt时进行一些参数配置,以减少生成的目标文件的大小和section数量。具体可以在configure命令中加入一些参数,例如:
```
-opensource -confirm-license -debug-and-release -no-warnings-are-errors -platform win32-g++ -no-qml-debug -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -no-openssl -skip qtwebengine -skip qt3d -skip qtgamepad -skip qtlocation -skip qtwebchannel -skip qtwebsockets -skip qtx11extras -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttranslations -skip qtwayland -skip qtwinextras -skip qtvirtualkeyboard -skip qttools -skip qtquickcontrols -skip qtandroidextras -skip qtcharts -skip qtdatavis3d -skip qtmacextras -skip qtpurchasing -skip qtremoteobjects -skip qtscript -skip qtscxml -skip qtsvg -skip qtwebview -no-angle
```
这些参数将会跳过一些不必要的模块,从而减少生成的目标文件的大小和section数量。
minGw64编译Qt时遇到too many sections问题
这个问题是由于MinGW编译器版本太老导致的,可以尝试升级MinGW编译器。
另外,也可以在编译Qt时通过配置减少生成的section数量,具体可以在configure命令中加入参数“-no-dwarf2 -no-exceptions -no-rtti -no-optimized-qt3d -no-optimized-qtwebengine”,这样可以减少生成的section数量,从而避免该问题的发生。