You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Can't run C++ code after updating the Command line tools(maybe?)

blackole@Divyanss-MacBook-Air ~ % g++ test.cpp 
ld: warning: ignoring duplicate libraries: '-lgcc'
0  0x102fd7648  __assert_rtn + 72
1  0x102f0bfac  ld::AtomPlacement::findAtom(unsigned char, unsigned long long, ld::AtomPlacement::AtomLoc const*&, long long&) const + 1204
2  0x102f21924  ld::InputFiles::SliceParser::parseObjectFile(mach_o::Header const*) const + 15164
3  0x102f2ee30  ld::InputFiles::parseAllFiles(void (ld::AtomFile const*) block_pointer)::$_7::operator()(unsigned long, ld::FileInfo const&) const + 420
4  0x18f1b4440  _dispatch_client_callout2 + 20
5  0x18f1c9544  _dispatch_apply_invoke_and_wait + 224
6  0x18f1c884c  _dispatch_apply_with_attr_f + 1180
7  0x18f1c8a38  dispatch_apply + 96
8  0x102fa93b8  ld::AtomFileConsolidator::parseFiles(bool) + 292
9  0x102f4a170  main + 9048
ld: Assertion failed: (resultIndex < sectData.atoms.size()), function findAtom, file Relocations.cpp, line 1336.
collect2: error: ld returned 1 exit status

I don't know what's happening, can't find anything at Google.

Please help, its really important for my work to compile C++ using gcc.

MacBook Air 13″, macOS 13.5

Posted on Sep 19, 2023 10:30 AM

Reply
Question marked as Top-ranking reply

Posted on Sep 20, 2023 12:08 AM

Its the issue of Xcode CLT 15. As I downgraded to Xcode CLT 14. Now everything seems to work as it was.

Similar questions

25 replies

Can't run C++ code after updating the Command line tools(maybe?)

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.