简体   繁体   English

使用mbed开发时,vim Syntastic找不到头文件

[英]vim Syntastic not finding header files when developing with mbed

I'm developing a prototype using ARM's mbed OS. 我正在使用ARM的mbed OS开发原型。 I'm newish to C++ so having syntastic working would be ideal, but it gets hung up on the import of "mbed.h". 我对C ++不熟悉,因此进行合成工作将是理想的选择,但它会挂在“ mbed.h”的导入上。

The structure of the project is: 该项目的结构为:

  • / /
  • myfile.cpp myfile.cpp
  • mbed-os/ mbed-os /
    • mbed.h mbed.h

Syntastic is saying fatal error: 'mbed.h' file not found . Syntastic表示fatal error: 'mbed.h' file not found

How can I get Syntastic / GCC (or whatever it's using) to find the header files? 如何获取Syntastic / GCC(或正在使用的任何文件)来查找头文件?

UPDATE: 更新:

Looks like including a .syntastic_cpp_config file with the following in is helping (but involved an absurdly painful process of add a line, run Syntastic, find the next missing header file): 看起来包括.syntastic_cpp_config文件以及以下内容是有帮助的(但涉及添加行,运行Syntastic,查找下一个缺少的头文件的过程非常痛苦):

-Imbed-os
-Imbed-os/cmsis
-Imbed-os/cmsis/TARGET_CORTEX_M
-Imbed-os/cmsis/TARGET_CORTEX_M/TOOLCHAIN_GCC
-Imbed-os/drivers
-Imbed-os/events
-Imbed-os/features
-Imbed-os/hal
-Imbed-os/platform
-Imbed-os/rtos
-Imbed-os/targets
-Imbed-os/targets/TARGET_NORDIC/TARGET_NRF5
-Imbed-os/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52832
-Imbed-os/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52832/TARGET_NRF52_DK
-Imbed-os/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52832/device
-Imbed-os/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/device
-Imbed-os/tools

This isn't a complete list at all, but I'd almost rather just hit compiler errors at this state and work with those rather than continue hunting for header files. 这根本不是一个完整的列表,但我几乎宁愿只是在这种状态下遇到编译器错误并使用这些错误,而不是继续寻找头文件。

You can get an exhaustive list of flags by generating the Makefile of your project with : 您可以通过生成项目的Makefile来获得标志的详尽列表:
mbed export -i make_gcc_arm -m K64F --profile mbed-os/tools/profiles/debug.json

cf: https://os.mbed.com/docs/v5.6/tools/debugging.html cf: https//os.mbed.com/docs/v5.6/tools/debugging.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM