embedXcode find Arduino system library header files

Arduino play on Mac,In addition to the official use of the simple addition of IDE,You can also choose to use Xcode to develop。

use embedXcode Plug-ins can make Xcode transformed into embedded development IDE,Including native compilation、Uploading full set of features。

embedxcode plugin allows Xcode to support embedded development

embedxcode plugin allows Xcode to support embedded development

but,In the standard library when it is a problem,For example, the figure above,I was testing nRF24L01 The SPI module,Need to use SPI.h This header file,General wording is: #include <spi.h>

however,This time to compile in Xcode words,Originally normal code has encountered an error:

SPI.h not directly include

SPI.h not directly include

Of course,If you go this time, then compile an official IDE,Everything is normal,Then the problem lies in the Xcode。

Here we find the header file manually position,It is located in the official IDE program documentation directory:

As shown above,Relatively deep directory,Official their IDE natural no problem,But for it embedXcode,A bit painful - to be able to support all libraries - the only path references to ~/Library/Arduino15/packages/arduino/hardware/apr/1.6.11/libraries ,so,When reference,You wrote: #include <SPI / src / spi.h>

Such,Xcode can be identified。

Of course,In this case put the official IDE Lane and die,Current word,Anyway, few include,Manually change with it,If more, then ...... use macros to define it。

Update,Thanks @rei_vilo ,In fact, embedXcode You should not directly reference the header files that you needed,But it should require the system library in your build directory,Then you can modify the corresponding parameter in the makefile,For example, this corresponds to my situation,Then it should be found in the makefile

APP_LIBS_LIST = 0 Then it changed to APP_LIBS_LIST = SPI

Thus,IDE will help you do the rest of the。

Further reading:

Libraries APP_LIBS_LIST and USER_LIBS_LIST Variables

Original article written by LogStudio:R0uter's Blog » embedXcode find Arduino system library header files

Reproduced Please keep the source and description link:https://www.logcg.com/archives/1761.html

About the Author

R0uter

The non-declaration,I have written articles are original,Reproduced, please indicate the link on this page and my name。

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *