【发布时间】:2017-05-03 10:44:09
【问题描述】:
我正在尝试包含一个包含在其父目录中的 .h 文件。看起来像这样:
.
├── fan_controller
├── ip_camera
├── motors
├── pose_and_distance
└── serial_communication
编辑:它们是不同的“子项目”,每个都包含一个独立的 CMakeList,我在子项目 Fan_controller 中工作,其中包含它的 main 和它的 CmakeList,我想使用 motors 目录中的文件。
他们有不同的文件,我在 fan_controller 的 main 中工作,我试图通过这样做来包含一个位于电机内部的文件:
#include "../motors/src/resources/classes/Arduino.h"
如果我把全局路径它工作正常:
#include "/home/kailegh/catkin_ws/src/project/motors/src/resources/classes/Arduino.h"
问题是文件在那里,我检查了几次,QT 自动完成路径,所以它找到了它。但是,当我尝试编译时,它会说:
no such file or directory
我不知道为什么会这样,我应该在 CmakeList 中添加一些东西吗?问题是文件在那里!! 提前非常感谢!
【问题讨论】:
标签: c++ compilation cmake include include-path