When I use QT Creator, I am in. Pro file includes include.pri file, but when I really compiled, I reported an error, saying that I could not find the header file in the corresponding environment, the following is some of my code and the corresponding error information, I do not know how to solve this problem, and why this problem occurs.
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++17
# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES +=
main.cpp
mainwindow.cpp
HEADERS +=
mainwindow.h
FORMS +=
mainwindow.ui
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
include (D:/data/opencv-4.10.0/opencv-4.10.0/_build/opencv.pri)
INCLUDEPATH += D:/data/opencv-4.10.0/opencv-4.10.0/_build/install/include
Debug:{
LIBS += -lD:/data/opencv-4.10.0/opencv-4.10.0/_build/install/x64/vc17/lib/opencv_world4100d
}
Release:{
LIBS += -lD:/data/opencv-4.10.0/opencv-4.10.0/_build/install/x64/vc17/lib/opencv_world4100
}
:-1: error: dependent '............dataopencv-4.10.0opencv-4.10.0_buildinstallincludeopencv2opencv.hpp' does not exist.
I tried adding an -I parameter to my includepath, using relative paths, etc., but it didn’t work
New contributor
望曉天 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.