在Mac上编译QT项目时,遇到以下错误

ld: file not found: QtCore.framework/Versions/4/QtCore for architecture x86_64

这是不正确的,因为我有64位架构可用,如下所示
$ cd
/Library/Frameworks/QtCore.framework/Versions/4
$ file QtCore
QtCore: Mach-O universal binary with 2 architectures
QtCore (for architecture x86_64):   Mach-O 64-bit dynamically linked shared library x86_64
QtCore (for architecture i386): Mach-O dynamically linked shared library i386

似乎是什么问题?

更新:
ld命令行是
/usr/bin/c++   -dynamiclib -Wl,-headerpad_max_install_names   -compatibility_version 1.0.0 -current_version 1.0.5 -o libjreen.1.0.5.dylib -install_name /Users/sb/Work/QuiKast/jabber/libjreen-1.0.5/build/libjreen.1.dylib ./src/abstractroster.cpp.o ./src/action.cpp.o ./3rdparty/jdns/moc_qjdns.cpp.o ./3rdparty/jdns/moc_qjdns_p.cpp.o -F/usr/local/lib /opt/local/lib/libQtNetwork.dylib /opt/local/lib/libQtCore.dylib -framework qca /usr/lib/libz.dylib


$ file /opt/local/lib/libQtCore.dylib
/opt/local/lib/libQtCore.dylib: Mach-O 64-bit dynamically linked shared library x86_64

最佳答案

新增中

-framework QtCore

解决了这个问题

10-08 09:44