【问题标题】:eclipse cdt not seeing header files in project packages?eclipse cdt 看不到项目包中的头文件?
【发布时间】:2012-03-24 07:59:03
【问题描述】:

我正在尝试编译一个项目,但我立即收到一个错误,它没有看到项目内某些包中的头文件。这是一张图片,注意它没有找到 AwarenessMoment.h 文件,但它在里面。

这是输出:

    **** Build of configuration Debug for project RoyOS ****
    
    make all
    Building file: ../src/royos/vision/ImageRecognizer.cpp
    Invoking: GCC C++ Compiler
    g++ -I/home/igvc/Documents/teamigvc/trunk/RoyOS -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/royos/vision/ImageRecognizer.d" -MT"src/royos/vision/ImageRecognizer.d" -o"src/royos/vision/ImageRecognizer.o" "../src/royos/vision/ImageRecognizer.cpp"
    In file included from ../src/royos/vision/ImageRecognizer.cpp:8:0:
    ../src/royos/vision/ImageRecognizer.h:11:29: fatal error: AwarenessMoment.h: No such file or directory
    compilation terminated.
    make: *** [src/royos/vision/ImageRecognizer.o] Error 1

有人知道为什么看不到这些头文件吗?

谢谢

【问题讨论】:

    标签: eclipse gcc compiler-construction g++ eclipse-cdt


    【解决方案1】:

    给编译器的包含路径肯定有问题。预处理器无法从您尝试编译的源文件中找到头文件。

    我认为你可以通过替换来解决这个问题

    #include "AwarenessMoment.h"

    #include "../sensor/AwarenessMoment.h"

    或者改变编译器包含路径以包含传感器目录并使用:

    #include <AwarenessMoment>

    【讨论】:

    • 乐于助人:)。顺便说一句,屏幕上的努力很好。应该还有更多!
    猜你喜欢
    • 2012-01-18
    • 2016-10-22
    • 1970-01-01
    • 2013-05-27
    • 2012-03-28
    • 2021-11-20
    • 1970-01-01
    • 2012-04-10
    • 1970-01-01
    相关资源
    最近更新 更多