INCLUDEPATH in qmake project file doesn't work

前端 未结 12 2099
梦如初夏
梦如初夏 2020-12-06 09:53

I\'ve got a problem with include in a qmake project. In my .pro file I\'ve got:

INCLUDEPATH += \"C:\\OpenCV\\build\\include\"

and in my cpp

12条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-06 10:26

    You need to do several things. Fist, in the .pro file, you need quotation marks two backslashes at a time, like this:

    INCLUDEPATH += "C:\\OpenCV\\build\\include\\opencv\\cv.h"
    

    You alse need a frontslash in the #include in your .cpp file like this:

    #include 
    

    When you've done this, delete the build folder. This is the folder with a very complicated name of the type build-untitled-Desktop_Qt_5_7_0_MSVC2015_32bit-Release. Then, in the Build menu, press "Run qmake". When you've done all this, it should compile fine.

提交回复
热议问题