I am using the Desk Top DE and the TinyGPS++ libraries.
When I select a Photon device, the code compiles without errors.
When I select the Electron device, I get the following errors:
"expected unqualified-id before 'double’
TinyGPS++.h:38:16"
line 38: double radians(double deg);
{the error repeats fro all lines of code with the same structure}
The same code compiled for Electron without errors on 2/20/17
// Tracking using external GPS
// External GPS - 4800 baud NMEA
//
#include "Particle.h"
// Port of TinyGPS for the Particle AssetTracker
// https://github.com/mikalhart/TinyGPSPlus
#include "TinyGPS++.h"
SYSTEM_THREAD(ENABLED);
/*
This sample sketch demonstrates the normal use of a TinyGPS++ (TinyGPSPlus) object directly.
*/
// The TinyGPS++ object
TinyGPSPlus gps;
void setup()
{
}
// Loop reading and processing GPS data
void loop()
{
while (Serial1.available() > 0) {
if (gps.encode(Serial1.read())) {
displayInfo();
}
}
}
// Process GPS data
void displayInfo()
{
}
Not sure, Dev (Desktop IDE) should use the current default (0.6.0) - testing why not.
But AFAIK the target selection should be comming soon for Dev too
Update:
Above code builds for me in Dev just fine for an Electron.
Does not DEV always use the latest release of the firmware - 0.6.0? This is the firmware that I have loaded on all my devices. Still does not compile in my environment - any suggestions?
I believed you. I have been out running errands for a few hours, came back and now it works with both devices without any errors - a puzzle and kind of scary because the compile errors were is C++ statement which should be independent of the device. Thank you for your help.
sorry for bouncing the old thread - I came across it when trying to compile an electron project using TinyGPS++
I have an electron asset tracker with firmware 0.6.1. When I try to compile (Particle Dev) the above example for this firmware version, I get the errors mentioned initially in this thread:
"expected unqualified-id before ‘double’ TinyGPS++.h
I also tried using CLI for compiling (particle compile electron --target 0.6.1) and got the same result. However, compiling for an old firmware (particle compile electron --target 0.6.0) works fine. I am stuck at this - I need to compile the code for 0.6.1. Thank you for your help!
Hello, I am experiencing the same issue it seems like. Tried to compile TinyGPS++ against an Electron with version 0.6.1 and it fails with the errors mentioned above:
"expected unqualified-id before 'double’
TinyGPS++.h:38:16"
line 38: double radians(double deg);
Tried to compile with version 0.6.0 and it worked ok. Also compiled ok with 0.6.2.rc1.