mxcl/homebrew — pull request #11198 by tmf (2012-03-25 11:39:00+00:00)
Title: llvm-gcc does not find needed std library calls for Moc: adding -lstdc++...

... arg solves the problem (qt 4.8.0, osx 10.7.3, XCode 4.3.2)

Error:
/usr/bin/llvm-gcc -L/usr/X11/lib -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -Xarch_x86_64 -mmacosx-version-min=10.5 -o ../../../bin/moc release-shared/moc.o release-shared/preprocessor.o release-shared/generator.o release-shared/parser.o release-shared/token.o release-shared/main.o -L/usr/X11/lib -L/private/tmp/homebrew-qt-4.8.0-7Xsl/qt-everywhere-opensource-src-4.8.0/src/tools/bootstrap -lbootstrap -L/usr/X11/lib -framework CoreServices -lz -lz
Undefined symbols for architecture x86_64:
"std::terminate()", referenced from:
Moc::parseClassHead(ClassDef*) in moc.o
Moc::checkProperties(ClassDef*) in moc.o
Moc::checkSuperClasses(ClassDef*) in moc.o
Moc::lexemUntil(Token) in moc.o
Moc::parseType() in moc.o
Moc::parseEnum(EnumDef*) in moc.o
Moc::parseInterfaces(ClassDef*) in moc.o
...
"operator new(unsigned long)", referenced from:
QList::detach_helper(int) in moc.o
QList::detach_helper(int) in moc.o
QList::detach_helper(int) in moc.o
QList::detach_helper(int) in moc.o
QList >::detach_helper(int) in moc.o
QList::detach_helper(int) in moc.o
QList >::detach_helper(int) in moc.o
...
"operator delete(void*)", referenced from:
Moc::parseSlotInPrivate(ClassDef*, FunctionDef::Access) in moc.o
Moc::parseSignals(ClassDef*) in moc.o
Moc::parseSlots(ClassDef*, FunctionDef::Access) in moc.o
Moc::parse() in moc.o
QList::detach_helper(int) in moc.o
QList::~QList() in moc.o
QList::detach_helper(int) in moc.o
...
"operator new[](unsigned long)", referenced from:
normalizeType(char const*, bool)in moc.o
Generator::generateMetaObject(bool) in generator.o
qstrdup(char const*)in libbootstrap.a(qbytearray.o)
QHashData::rehash(int) in libbootstrap.a(qhash.o)
QHashData::detach_helper2(void (*)(QHashData::Node*, void*), void (*)(QHashData::Node*), int, int)in libbootstrap.a(qhash.o)
QDirPrivate::sortFileList(QFlags, QList&, QStringList*, QList*)in libbootstrap.a(qdir.o)
QIODevicePrivateLinearBuffer::makeSpace(unsigned long, QIODevicePrivateLinearBuffer::FreeSpacePos)in libbootstrap.a(qiodevice.o)
...
"operator delete[](void*)", referenced from:
normalizeType(char const*, bool)in moc.o
qputenv(char const*, QByteArray const&)in libbootstrap.a(qglobal.o)
QHashData::rehash(int) in libbootstrap.a(qhash.o)
QHashData::free_helper(void (*)(QHashData::Node*))in libbootstrap.a(qhash.o)
QHashData::destroyAndFree() in libbootstrap.a(qhash.o)
QDirPrivate::sortFileList(QFlags, QList&, QStringList*, QList*)in libbootstrap.a(qdir.o)
QIODevicePrivate::~QIODevicePrivate()in libbootstrap.a(qiodevice.o)
...
"___gxx_personality_v0", referenced from:
Dwarf Exception Unwind Info (__eh_frame) in moc.o
Dwarf Exception Unwind Info (__eh_frame) in preprocessor.o
Dwarf Exception Unwind Info (__eh_frame) in generator.o
Dwarf Exception Unwind Info (__eh_frame) in parser.o
Dwarf Exception Unwind Info (__eh_frame) in main.o
Dwarf Exception Unwind Info (__eh_frame) in libbootstrap.a(qglobal.o)
Dwarf Exception Unwind Info (__eh_frame) in libbootstrap.a(qbytearray.o)
...
"___cxa_guard_acquire", referenced from:
global_callback_table() in libbootstrap.a(qglobal.o)
customTypes() in libbootstrap.a(qmetatype.o)
customTypesLock() in libbootstrap.a(qmetatype.o)
mutex() in libbootstrap.a(qregexp.o)
globalEngineCache() in libbootstrap.a(qregexp.o)
fileEngineHandlerMutex() in libbootstrap.a(qabstractfileengine.o)
fileEngineHandlers() in libbootstrap.a(qabstractfileengine.o)
...
"___cxa_guard_release", referenced from:
global_callback_table() in libbootstrap.a(qglobal.o)
customTypes() in libbootstrap.a(qmetatype.o)
customTypesLock() in libbootstrap.a(qmetatype.o)
mutex() in libbootstrap.a(qregexp.o)
globalEngineCache() in libbootstrap.a(qregexp.o)
fileEngineHandlerMutex() in libbootstrap.a(qabstractfileengine.o)
fileEngineHandlers() in libbootstrap.a(qabstractfileengine.o)
...
"vtable for __cxxabiv1::__si_class_type_info", referenced from:
typeinfo for QFilein libbootstrap.a(qfile.o)
typeinfo for QFilePrivatein libbootstrap.a(qfile.o)
typeinfo for QFSFileEnginePrivatein libbootstrap.a(qfsfileengine.o)
typeinfo for QFSFileEnginein libbootstrap.a(qfsfileengine.o)
typeinfo for QTemporaryFileEnginein libbootstrap.a(qtemporaryfile.o)
typeinfo for QTemporaryFilein libbootstrap.a(qtemporaryfile.o)
typeinfo for QTemporaryFilePrivatein libbootstrap.a(qtemporaryfile.o)
...
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for __cxxabiv1::__class_type_info", referenced from:
typeinfo for QIODevicePrivatein libbootstrap.a(qiodevice.o)
typeinfo for QIODevicein libbootstrap.a(qiodevice.o)
typeinfo for QDirIteratorin libbootstrap.a(qdiriterator.o)
typeinfo for QAbstractFileEnginePrivatein libbootstrap.a(qabstractfileengine.o)
typeinfo for QAbstractFileEnginein libbootstrap.a(qabstractfileengine.o)
typeinfo for QAbstractFileEngineIteratorin libbootstrap.a(qabstractfileengine.o)
typeinfo for QAbstractFileEngineHandlerin libbootstrap.a(qabstractfileengine.o)
...
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"___cxa_pure_virtual", referenced from:
vtable for QIODevicein libbootstrap.a(qiodevice.o)
vtable for QAbstractFileEngineIteratorin libbootstrap.a(qabstractfileengine.o)
vtable for QAbstractFileEngineHandlerin libbootstrap.a(qabstractfileengine.o)
vtable for QTextCodecin libbootstrap.a(qtextcodec.o)
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[1]: *** [../../../bin/moc] Error 1
make: *** [sub-moc-make_default-ordered] Error 2
==> Exit Status: 2
https://github.com/mxcl/master/blob/master/Library/Formula/qt.rb#L86
==> Build Environment
CPU: quad-core 64-bit sandybridge
MacOS: 10.7.3-x86_64
Xcode: 4.3.2
CC: /usr/bin/llvm-gcc => /usr/llvm-gcc-4.2/bin/llvm-gcc-4.2
CXX: /usr/bin/llvm-g++ => /usr/llvm-gcc-4.2/bin/llvm-g++-4.2
LD: /usr/bin/llvm-gcc => /usr/llvm-gcc-4.2/bin/llvm-gcc-4.2
CFLAGS: -Os -w -pipe -march=core2 -msse4
CXXFLAGS: -Os -w -pipe -fvisibility=hidden -march=core2 -msse4
CPPFLAGS: -I/usr/X11/include
LDFLAGS: -L/usr/X11/lib
MAKEFLAGS: -j4
Error: Failed executing: make (qt.rb:86)