【发布时间】:2020-10-06 13:35:53
【问题描述】:
我最近刚刚在 QT Creator 框架中编写了一个项目,它既使用 QT 库(如 QT_Widget),也使用 openCV 库(如 openCV_tracking)。 我的项目包括 .ui 、 .pro 、 main.cpp 和一些带有 .h 和 .cpp 文件的类。
我的 .pro 文件是:
QT += \
core gui \
concurrent widgets
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = Version7
TEMPLATE = app
DEFINES += QT_DEPRECATED_WARNINGS
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
CONFIG += \
c++11 \
cmdline
SOURCES += \
main.cpp \
mainwindow.cpp \
videoprocessor.cpp \
robottracker.cpp \
robotdetector.cpp \
obstaclesdetector.cpp \
pathcapture.cpp
HEADERS += \
mainwindow.h \
videoprocessor.h \
robottracker.h \
robotdetector.h \
obstaclesdetector.h \
pathcapture.h
FORMS += \
mainwindow.ui
# including openCV needed files
INCLUDEPATH += E:\\MyOpenCV\\install\\include
INCLUDEPATH += C:\\openCV\\opencv\\build\\include
LIBS += -LE:\\MyOpenCV\\install\\x64\\vc15\\lib \
-lopencv_tracking430
LIBS += -LC:\\openCV\\opencv\\build\\x64\\vc15\\lib \
-lopencv_world430
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
它在 QT creator 中运行没有问题;但现在我想与我的团队分享它,为此我想从中构建一个独立的 exe 文件,该文件静态链接项目中使用的所有库。 有人可以指导我如何使用 QT Creator 或其他一些选项来做到这一点吗? 在互联网上有一些建议,但没有奏效。
【问题讨论】:
标签: c++ qt opencv qt-creator static-linking