gpt4 book ai didi

qt - 将 OpenCV 库链接到 Qt

转载 作者:太空宇宙 更新时间:2023-11-03 21:46:08 26 4
gpt4 key购买 nike

我正在尝试创建一个界面应用程序,我需要在其中使用 OpenCV 在一个窗口中显示两个视频。我试过 Qt 但我有一些错误,如“未解析的外部符号”。我想我没有很好地将 Qt 链接到 OpenCV 库。这是我的“.pro”文件:

#-------------------------------------------------
#
# Project created by QtCreator 2014 - 10 - 31T11:03 : 55
#
#-------------------------------------------------

QT += core gui

greaterThan(QT_MAJOR_VERSION, 4) : QT += widgets

TARGET = test_Qt
TEMPLATE = app


SOURCES += main.cpp\
dialog.cpp

HEADERS += dialog.h

FORMS += dialog.ui

INCLUDEPATH += D:\\OpenCV231\\opencv\\build\\include

LIBS += -LD:\\OpenCV231\\mybuild\\lib\\Debug \
-lopencv_calib3d231d.lib \
-lopencv_contrib231d.lib \
-lopencv_core231d.lib \
-lopencv_features2d231d.lib \
-lopencv_flann231d.lib \
-lopencv_gpu231d.lib \
-lopencv_haartraining_engined.lib \
-lopencv_highgui231d.lib \
-lopencv_imgproc231d.lib \
-lopencv_legacy231d.lib \
-lopencv_ml231d.lib \
-lopencv_objdetect231d.lib \
-lopencv_ts231d.lib \
-lopencv_video231d.lib

谁能帮帮我?谢谢

最佳答案

.lib 放在这些地方就足够了:

-lopencv_calib3d231d.lib \
^^^^

应该会自动找到静态库,因此只需使用此架构即可:

-lopencv_calib3d231d \

如果您尝试明确指定扩展名,它将查找 (lib)opencv_food.lib.{lib/dll}

如果您希望获取静态库路径而不是动态库,您还可以指定整个静态库路径。

关于qt - 将 OpenCV 库链接到 Qt,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26690314/

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