1

在 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
4

1 回答 1

2

添加

-framework QtCore

解决了这个问题

于 2012-06-04T05:31:27.477 回答