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。
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:
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:
1 |
<del>~/Library/Arduino15/packages/arduino/hardware/avr/1.6.11/libraries/SPI/src/SPI.h</del> |
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。
Extended 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
embedXcode should be charged,Seeking its download package (money under it!),Thank you!