Qt: how to include path with space in pro

Viewed 733

Platform: Windows 10

Qt Version: 5.15.1

For example, I want to include this path C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt in the pro file.

Here are the ways I've tried:

  1. use $$quote():

    INCLUDEPATH += $$quote(C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt)
    
  2. use " ":

    INCLUDEPATH += "C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt"
    
  3. use $$quote and " " together:

    INCLUDEPATH += $$quote("C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt")
    
  4. change \\ to /:

    INCLUDEPATH += $$quote("C:/Program Files (x86)/Windows Kits/10/Include/10.0.18362.0/ucrt")
    

All no good, and this is the error I keep getting:

Qt Creator error

3 Answers

You need to quote with "" and use forward slashes without $$quote

To specify a path containing spaces, quote the path using the technique described in Whitespace.

win32:INCLUDEPATH += "C:/mylibs/extra headers"
unix:INCLUDEPATH += "/home/user/extra headers"

INCLUDEPATH

Try this :

INCLUDEPATH += "C:\'Program Files (x86)'\WindowsKits\10\Include\10.0.18362.0\ucrt"
Related