0

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 Oct 17 '15 at 1:56
  • Yes sir, I have. – Eduardo Gomez Oct 18 '15 at 1:05
  • In BikeTracker.ino, change the reference to PubNub.h to an absolute path. – CharlieHanson Oct 18 '15 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 Oct 18 '15 at 20:43
1

It turns out my Arduino IDE could not find PubNub.* files until I manually added them as a Library.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.