GCC 4.8 on Mac OS X v10.8 throws “Undefined symbols for architecture x86_64”

This is the case even with the old 4.2 GCC (I experienced this when I set up my unofficial iOS toolchain). gcc assumes C by default, and invokes the linker without linking to the C++ standard library; in contrast, g++ assumes C++ and links against the C++ standard library by default.

All in all – possible solutions:

gcc myprog.c -o myprog -lstdc++

or

g++ myprog.c -o myprog

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)