gpt4 book ai didi

c++ - 链接错误 : QtCore. framework/Versions/4/QtCore for architecture x86_64

转载 作者:行者123 更新时间:2023-11-30 04:28:32 25 4
gpt4 key购买 nike

在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

解决了这个问题

关于c++ - 链接错误 : QtCore. framework/Versions/4/QtCore for architecture x86_64,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10065085/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com