Qt Creator can't find headers (says: “No such file or directory”)

前端 未结 6 1032
轻奢々
轻奢々 2021-02-05 10:11

How can I tell Qt Creator 2.4.1 (based on Qt 4.7.4 32-bit) where to look by default for header files?

When I open a C file in Qt Creator and say



        
6条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-05 10:52

    add INCLUDEPATH to "project.pro" file
    
    example for raspberry pi qt projects:
    # Qt Creator can't find headers (says: “No such file or directory”)
    # add compile includes
    INCLUDEPATH += /home/user/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/arm-linux-gnueabihf/libc/usr/include/ \
                   /home/user/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/arm-linux-gnueabihf/libc/usr/include/arm-linux-gnueabihf/
    # pi rootfs includes
    INCLUDEPATH += /home/user/raspi/sysroot/usr/include/
    

提交回复
热议问题