hsutter / cppfront

A personal experimental C++ Syntax 2 -> Syntax 1 compiler
Other
5.48k stars 242 forks source link

[BUG] Error when i try to build cppfront #1227

Open fenix272 opened 2 months ago

fenix272 commented 2 months ago

g++ cppfront.cpp -std=c++20 -o cppfront C:/codeblocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/13.1.0/../../../../x86_64-w64-mingw32/bin/as.exe: C:\Users\Dio\AppData\Local\Temp\ccY6j4zz.o: too many sections (41204) C:\Users\Dio\AppData\Local\Temp\ccsHBHmj.s: Assembler messages: C:\Users\Dio\AppData\Local\Temp\ccsHBHmj.s: Fatal error: can't write 11 bytes to section .text of C:\Users\Dio\AppData\Local\Temp\ccY6j4zz.o: 'file too big' C:/codeblocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/13.1.0/../../../../x86_64-w64-mingw32/bin/as.exe: C:\Users\Dio\AppData\Local\Temp\ccY6j4zz.o: too many sections (41204) C:\Users\Dio\AppData\Local\Temp\ccsHBHmj.s: Fatal error: C:\Users\Dio\AppData\Local\Temp\ccY6j4zz.o: file too big

That's the error i get when i run the command: "g++ cppfront.cpp -std=c++20 -o cppfront" on windows 7 using mingw g++ version 13.1.0

DyXel commented 2 months ago

Posts online say that you should be passing a flag for big objects to the assembler... Something along the lines of g++ cppfront.cpp -std=c++20 -Wa,-mbig-obj -o cppfront. Could you try that?

hsutter commented 2 months ago

Right, when I build with MSVC with some options I need to specify /bigobj.

Googling for "mingw /bigobj" led me to this StackOverflow question where the chosen answer was as @DyXel said: "The solution is to add the option -Wa,-mbig-obj if your version of GCC supports that option. You probably only need it during the compilation step, not the linker step. If your compiler does not support that option, you should look into using mingw-w64 and MSYS2."

Can you try that and report back whether it solved the problem or not? Thanks!