如何使用 qt Creator 配置 opencv 2.3 以使用 qt sdk 安装中的 Stock mingw 编译器

发布于 2024-12-27 23:09:08 字数 609 浏览 0 评论 0原文

很抱歉问了一些人已经问过的问题.. 但即使经过很多天的搜索和尝试,我仍无法使 opencv 与 qt Creator 一起工作。 希望任何人都能给我这样做的步骤。

上次我尝试仅调用一个 opencv 特定函数来检查它是否正确编译,但它给出了一些由于链接问题而导致的错误,我已经使用我的 mingw 编译器从代码块构建了 opencv 库,如一些教程中所述,即使这样也不起作用。

我收到这个错误

:-1:错误:找不到-lopencv_core

:-1: 错误:collect2: ld 返回 1 退出状态

我的pro文件如下所示

QT += core

TARGET = Open_cv_integration

CONFIG += console

TEMPLATE = app

SOURCES += main.cpp

LIBS +=“C:/opencv2.2MinGW/lib/libopencv_core231.dll.a”

LIBS +=-lm -lopencv_core -lopencv_highgui -lopencv_video -lopencv_imgproc

Sorry for asking a question thats already asked by some..
But even after many days of search and tries i couldnt make opencv work with qt creator..
Hope any body can give me the steps for doing so.

Last time i tried by calling just one opencv specific function to check if it compiles correctly, but its giving some errors which are due to linking problems, i have built the opencv library using my mingw compiler from code blocks as described in some of the tutorials, even that didnt work.

I'm getting this error

:-1: error: cannot find -lopencv_core

:-1: error: collect2: ld returned 1 exit status

My pro file looks as follows

QT += core

TARGET = Open_cv_integration

CONFIG += console

TEMPLATE = app

SOURCES += main.cpp

LIBS += "C:/opencv2.2MinGW/lib/libopencv_core231.dll.a"

LIBS += -lm -lopencv_core -lopencv_highgui -lopencv_video -lopencv_imgproc

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一刻暧昧 2025-01-03 23:09:08
LIBS += \
  -LD:\your lib directory\ -llibopencv_highgui231 \
INCLUDEPATH += \
   D:/your include dir/include/

应该为你工作。
QtCreator有很好的帮助,里面说了如何将lib添加到项目中。

LIBS += \
  -LD:\your lib directory\ -llibopencv_highgui231 \
INCLUDEPATH += \
   D:/your include dir/include/

should work for you.
QtCreator has very good help, and there is said how to add lib to project.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文