OpenCV 与 QT Creator 构建错误
我不久前下载了 qt,最近才开始使用 QT Creator。
我正在尝试使用 pkg-config 集成 Opencv。
pro 文件是:
QT += core gui
TARGET = QTTest
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui
unix: CONFIG+=link_pkgconfig
unix: PKGCONFIG+=opencv
我尝试过包括两种不同的方式并尝试过。
我试图简单地运行以下命令
cv::Mat* mat;
,但它给了我两个错误: 未找到架构 x86_64 的符号 collect2: id returned 1 exit status
它还给了我一个警告。
警告“此版本的 Mac OSX 不受支持。”
任何人都可以帮助或启发我如何解决这个问题。非常感谢任何帮助。 :-D
I downloaded qt a while ago and have just now recently started playing around with QT creator.
I am trying to get Opencv integrated using pkg-config.
The pro file is:
QT += core gui
TARGET = QTTest
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui
unix: CONFIG+=link_pkgconfig
unix: PKGCONFIG+=opencv
I have tried including two different ways and tried .
I'm trying to simply run the following
cv::Mat* mat;
and it gives me 2 errors:
symbol(s) not found for architecture x86_64
collect2: id returned 1 exit status
It also gives me a warning.
warning "This version of Mac OSX is unsupported."
Can anyone help or enlighten me on what to do for fixing this. Any help is greatly appreciated. :-D
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
未找到符号
错误表示您尚未链接代码访问的库。osx 警告是因为您可能使用的是 Linux 发行版,在这种情况下,库的扩展名为 .so,而不是 .dylib。
不幸的是我目前无法在Linux 上进行测试。
尝试遵循 Linux 教程,应该有 <一个href="https://www.google.co.uk/search?q=opencv%20qt%20linux&aq=f&sugexp=chrome,mod=18&sourceid=chrome&ie=UTF-8#hl=en& ;safe=off&sclient=psy-ab&q=opencv%20qt%20linux%20library%20link&oq=o pencv%20qt%20linux%20library%20link&gs_l=serp.3...143.1618.1.2721.5.5.0.0.0.0.105.382.4j1.5.0...0.0...1c .qERByO89P78&pbx=1&bav=on.2,or.r_gc.r_pw.r_cp.r_qf.&fp=c013475c1f5d647&biw=1276&bih=683" rel="nofollow">有很多
The
symbol(s) not found
error means you haven't linked the libraries accessed by the code.The osx warning is because you're probably using a linux distribution, in which case the libraries will have the .so extension, not .dylib.
Unfortunately I can't test on linux at the moment.
Try to follow a Linux tutorial, there should be plenty out there
您的问题一定是您有一个未定义但已声明的插槽。 (这是小部件上的操作回调函数。也许您不小心在设计器中创建了按钮的单击回调函数。)
我的错误消息是相同的,在这里我找到了答案:Qt & C++:错误:未找到架构 x86_64 的符号,collect2:ld 返回 1 退出状态
Your problem must be that you have an undefined yet declared slot. (That is an action callback function on a widget. Maybe you accidentally created in the designer a click callback function of a button.)
My error msg was the same and here I have found an answer: Qt & C++: Error: symbol(s) not found for architecture x86_64, collect2: ld returned 1 exit status