I'm new to Arduino. When Arduino verifies this sketch https://github.com/MediaTek-Labs/Real-Time-Bicycle-Tracking-Map-using-PubNub throws the following:
Build options changed, rebuilding all
BikeTracker.ino: In function 'void setup()':
BikeTracker.ino:45:5: error: 'PubNub' was not declared in this scope
BikeTracker.ino: In function 'void loop()':
BikeTracker.ino:91:14: error: 'PubNub' was not declared in this scope
I've read most answers are pointing out to www.arduino.cc/en/Guide/Libraries some people say it's common Arduino linking issue (easy to fix) after tried out multiple approaches with no dice.
I've also followed PubNub customer support advice (with list of steps below) but no avail:
OCT 12, 2015 | 10:23AM PDT PubNub replied: Eduardo,
I got this from our hardware/IoT/embedded engineer:
You are probably not including all the libraries, or has the wrong path for them.
- When you download the source at MediaTek-Labs/Real-Time-Bicycle-Tracking-Map-using-PubNub on GitHub:
- Click .ino file and a pop up will ask if you need a new folder for the sketch – click Yes.
- Then copy the rest of the files from the source to this new folder.
- Compile it and see if you get any library path errors that you need to provide. Let me know if you require further assistance.
BTW this is my PubNub.h https://gist.github.com/egomez99/fb1d738ec39913629e9a
Hope someone can shed some lights.
-
And you're sure you've copied ALL the git files into your sketch folder?CharlieHanson– CharlieHanson2015年10月17日 01:56:45 +00:00Commented Oct 17, 2015 at 1:56
-
Yes sir, I have.Eduardo Gomez– Eduardo Gomez2015年10月18日 01:05:45 +00:00Commented Oct 18, 2015 at 1:05
-
In BikeTracker.ino, change the reference to PubNub.h to an absolute path.CharlieHanson– CharlieHanson2015年10月18日 09:10:30 +00:00Commented Oct 18, 2015 at 9:10
-
@CharlieHanson I know you're right. I'm just overlooking something stupid I can't figure it out! lol. This morning tried out to #include <PubNub.h> instead of predefined set up #include "PubNub.h" (as the github repo says). I did also try running this PubNubJsonWiFi PubNub.h already included system directive. When I fixed the #include <../aJson/aJSON.h> library the main issue reappeared (error: 'PubNub' was not declared ...). I'll keep looking at this and post feedback when I have any information. Ty!Eduardo Gomez– Eduardo Gomez2015年10月18日 20:43:06 +00:00Commented Oct 18, 2015 at 20:43
1 Answer 1
It turns out my Arduino IDE could not find PubNub.* files until I manually added them as a Library.