Compile errors with Electron but not with Photon in TinyGPS++.h

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’
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

I’m having the exact same issue. Was compiling fine yesterday (2/21/2017) and today it won’t compile.

Here is the simple code:

// Tracking using external GPS
// External GPS - 4800 baud NMEA

#include "Particle.h"

// Port of TinyGPS for the Particle AssetTracker
#include "TinyGPS++.h"
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( {

// Process GPS data
void displayInfo()

can you check what system version you are targeting?

I was using the CLI without a target version specified. I just tried adding “–target 0.6.0” as a parameter, and now it compiles successfully. Nice!

So what version was it using when I didn’t pass in the target parameter, and why doesn’t that work anymore?

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

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?

It doesn’t compile in Dev for me either, but I’m working around it for now by using CLI.

That’s odd, since it builds fine for me against any Particle device.

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.

Hey guys,

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!

0.6.1 has some difficulties with some libs due to some mixup with the Arduino compatibility features added.

Try building for 0.6.2-rc.1, 0.6.1-rc.1 or 0.6.1-rc.2

I am having the same exact issue… any updates on this?

Have you tried a different target?
That would be the minimum info that could be expected in addition to: “Same here”

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’
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.