With much help from Jantje, the author of the Eclipse Arduino plugin, I’ve been able to tweak the Blynk Arduino library to compile Blynk programs under both the Arduino IDE and Eclipse Arduino. Jantje wrote:
"For the first solution the question is: “Can I convince the author of the library to add a (empty is ok) Blynk.h file? And more importantly: Is the Author willing to add #include “Blynk.h” to all the examples.
This has no negative impact on the hex file, The working of Arduino IDE (should be more reliable) and it makes the plugin capable of doing auto Include of the library.
It is less than 5 minutes work, but it is the author of the lib his call.”
From this, I found I needed to take 4 steps to make Blynk 0.3.6 Eclipse-compatible:
- Create “
.../libraries/Blynk/Blynk.h” and #include it before including any Blynk libraries.
- Likewise create and include “
- Delete the entire folder “
- In those Blynk projects I had already imported to Eclipse Arduino and tried to compile, delete the .ino.cpp hidden file and do a clean build.
This recipe works for me under MacOS 10.11.5, the Eclipse Arduino IDE nightly build, and ArduinoIDE version 1.6.9. It should be reproducible by anyone wishing to compile Blynk programs in Eclipse. Under OSes other than Mac, especially linux, step 3 may need to be modified. I deleted the
linux folder to prevent Eclipse from compiling
BlynkDebug.cpp from there which resulted in multiple definition errors at link time.
Alternatively, if the developers are willing to make this small change to the library configuration, it should make the libraries Eclipse compatible for everyone - with possible tweaks for OS-dependence as I noted above.
Many thanks to Jantje for his suggestion - I had tried everything else I could think of to make it work.