Skip to main content
Arduino

Return to Revisions

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:

  1. Click IDE's File-Preferences and find where it storages preferences.txt. Mine is at C:\Users\Administrator\AppData\Roaming\Arduino15\preferences.txt
  2. 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.
  3. Because the .h Arduino automatically generated from our .ino is in ArduinoBuild directory, you can now use #include "./../Share/SomeShare.h" in order to include the D:\MyProject\Share\SomeShare.h

Here is the same question asked in another stackexchange board: Here

AltStyle によって変換されたページ (->オリジナル) /