INCLUDEPATH in qmake project file doesn't work

前端 未结 12 2097
梦如初夏
梦如初夏 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:17

    Under windows you have to eliminate the -I before each directory that is added into the INCLUDEPATH variable. For example: Under windows:

    INCLUDEPATH += "C:\lib\boost_1_61_0" (back-slash)
    

    Under linux & mac:

    INCLUDEPATH += -I"$$(HOME)/lib/boost_1_61_0" (note the -I and forward-slash)
    

    I'm not sure whether it depends on different qmake version or not. But after finishing qmake command, I check the Makefile and the double -I is the issue.

提交回复
热议问题