whenever I try to "g++ file.cpp" I get the following error message,
0 0x1008a81a0 __assert_rtn + 140
1 0x10072fa8c mach_o::relocatable::Parser<arm64>::parse(mach_o::relocatable::ParserOptions const&) + 4536
2 0x100701d38 mach_o::relocatable::Parser<arm64>::parse(unsigned char const*, unsigned long long, char const*, long, ld::File::Ordinal, mach_o::relocatable::ParserOptions const&) + 148
3 0x10076a4ac ld::tool::InputFiles::makeFile(Options::FileInfo const&, bool) + 1468
4 0x10076d360 ___ZN2ld4tool10InputFilesC2ER7Options_block_invoke + 56
5 0x18c69c1f4 _dispatch_client_callout2 + 20
6 0x18c6b0f8c _dispatch_apply_invoke_and_wait + 224
7 0x18c6b026c _dispatch_apply_with_attr_f + 1152
8 0x18c6b047c dispatch_apply + 108
9 0x10076d1f4 ld::tool::InputFiles::InputFiles(Options&) + 616
10 0x1006ef6c0 main + 552
A linker snapshot was created at:
/tmp/a.out-2022-09-15-161557.ld-snapshot
ld: Assertion failed: (_file->_atomsArrayCount == computedAtomCount && "more atoms allocated than expected"), function parse, file macho_relocatable_file.cpp, line 2061.
collect2: error: ld returned 1 exit status
ā ~
I tried unistalling and reinstalling gcc, Xcode CLI, and Xcode. Nothing seems to fix it!
Note: The code compiles on Xcode, I only face this problem with gcc.