2 of 2
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Thanks to everybody, now I get a better solution. It is changing the build path
to our working directory, and then we can use relative path!
Here are the deatiled steps:
- Click IDE's
File-Preferences
and find where it storagespreferences.txt
. Mine is atC:\Users\Administrator\AppData\Roaming\Arduino15\preferences.txt
- In the txt file add this line:
build.path=D:\MyProject\ArduinoBuild
. This means let Arduino put the temp files in this directory, such as the.h
waiting to compile. - Because the
.h
Arduino automatically generated from our.ino
is inArduinoBuild
directory, you can now use#include "./../Share/SomeShare.h"
in order to include theD:\MyProject\Share\SomeShare.h
Here is the same question asked in another stackexchange board: Here
ch271828n
- 141
- 8