qt编译error: ‘opencv2/core/core.hpp‘ file not found

qt编译error: ‘opencv2/core/core.hpp’ file not found

opencv+Qt creater 的opencv配置语句

  1. #-------------------------------------------------
  2. #
  3. # Project created by QtCreator 2021-05-10T01:13:32
  4. #
  5. #-------------------------------------------------
  6. QT += core gui
  7. greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
  8. TARGET = 21_0510_Qt_test1
  9. TEMPLATE = app
  10. # The following define makes your compiler emit warnings if you use
  11. # any feature of Qt which has been marked as deprecated (the exact warnings
  12. # depend on your compiler). Please consult the documentation of the
  13. # deprecated API in order to know how to port your code away from it.
  14. DEFINES += QT_DEPRECATED_WARNINGS
  15. # You can also make your code fail to compile if you use deprecated APIs.
  16. # In order to do so, uncomment the following line.
  17. # You can also select to disable deprecated APIs only up to a certain version of Qt.
  18. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
  19. CONFIG += c++11
  20. SOURCES += \
  21. main.cpp \
  22. mainwindow.cpp
  23. HEADERS += \
  24. mainwindow.h
  25. FORMS += \
  26. mainwindow.ui
  27. INCLUDEPATH+= D:/Opencv420/opencv420_build/install/include/opencv \
  28. D:/Opencv420/opencv420_build/install/include/opencv2 \
  29. D:/Opencv420/opencv420_build/install/include
  30. LIBS+=D:/Opencv420/opencv420_build/install/x64/vc14/lib/opencv_*.a
  31. # Default rules for deployment.
  32. qnx: target.path = /tmp/$${ TARGET}/bin
  33. else: unix:!android: target.path = /opt/$${ TARGET}/bin
  34. !isEmpty(target.path): INSTALLS += target

首先保证在VS中能正常测试opencv。如果qt出现这个,说明链接的库没有对,仔细检查路劲。

发表评论

表情:
评论列表 (有 0 条评论,71人围观)

还没有评论,来说两句吧...

相关阅读