I need to compile a C++ program on Windows using the CLion IDE with CMake
and Qt Creator with QMake
.
On Linux, I do not get any problems at all.
On Windows, I wanted to use the MinGW
compiler. My source code relies on boost
. Therefore, according to this question, I was installing the compiler from the MinGW Distro.
So far so good. Now, during the compilation process I get the following error:
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/as.exe: CMakeFiles\[...]: too many sections (52187)
C:\Users\MATTHI~1\AppData\Local\Temp\cc2TyXHu.s: Assembler messages:
C:\Users\MATTHI~1\AppData\Local\Temp\cc2TyXHu.s: Fatal error: can't write 231 bytes to section .text of CMakeFiles\[...]: 'file too big'
after some research, (here and here) I found out that heavy templating might be the reason for this issue... However, I do not do any templating at all, but I'm including the Eigen libraries that might cause the issue.
In any case, I need to fix this and the proposed solution is to add the following flags to my compiler:
-Wa,-mbig-obj
.
My question now is: how can I do this in my IDE (CLion or QtCreator) or in my CMakeLists.txt
(CMake) and/or myProject.pro
(QMake) files?