SlashDevin / NeoGPS

NMEA and ublox GPS parser for Arduino, configurable to use as few as 10 bytes of RAM
GNU General Public License v3.0
707 stars 195 forks source link

Error compiling for board Arduino Due #76

Closed Nerdsiah closed 6 years ago

Nerdsiah commented 6 years ago

With versions 4.2.4 and 4.2.5 I get this compiling error.

In file included from C:\Users\Pmac\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.11\cores\arduino/Arduino.h:31:0,

                 from C:\Users\Pmac\Documents\Arduino\libraries\NeoGPS\src\NMEAGPS.h:23,

                 from C:\Users\Pmac\Documents\Arduino\libraries\NeoGPS\src\NMEAGPS.cpp:18:

C:\Users\Pmac\Documents\Arduino\libraries\NeoGPS\src\NMEAGPS.cpp: In member function 'NMEAGPS::decode_t NMEAGPS::parseCommand(const NMEAGPS::msg_table_t*, uint8_t, char)':

C:\Users\Pmac\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.11\cores\arduino/avr/pgmspace.h:106:49: error: 'const void*' is not a pointer-to-object type

 #define pgm_read_ptr(addr) (*(const void *)(addr))

                                                 ^

C:\Users\Pmac\Documents\Arduino\libraries\NeoGPS\src\NMEAGPS.cpp:566:60: note: in expansion of macro 'pgm_read_ptr'

       const char *        table_i = (const char *        ) pgm_read_ptr( &table[i] );

                                                            ^

C:\Users\Pmac\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.11\cores\arduino/avr/pgmspace.h:106:49: error: 'const void*' is not a pointer-to-object type

 #define pgm_read_ptr(addr) (*(const void *)(addr))

                                                 ^

C:\Users\Pmac\Documents\Arduino\libraries\NeoGPS\src\NMEAGPS.cpp:590:49: note: in expansion of macro 'pgm_read_ptr'

         const char *table_next = (const char *) pgm_read_ptr( &table[next_msg] );

                                                 ^

C:\Users\Pmac\Documents\Arduino\libraries\NeoGPS\src\NMEAGPS.cpp: In member function 'const __FlashStringHelper* NMEAGPS::string_for(NMEAGPS::nmea_msg_t) const':

C:\Users\Pmac\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.11\cores\arduino/avr/pgmspace.h:106:49: error: 'const void*' is not a pointer-to-object type

 #define pgm_read_ptr(addr) (*(const void *)(addr))

                                                 ^

C:\Users\Pmac\Documents\Arduino\libraries\NeoGPS\src\NMEAGPS.cpp:651:52: note: in expansion of macro 'pgm_read_ptr'

       const char *        table_i = (const char *) pgm_read_ptr( &table[i] );

                                                    ^

C:\Users\Pmac\Documents\Arduino\libraries\NeoGPS\src\NMEAGPS.cpp: In static member function 'static void NMEAGPS::poll(Stream*, NMEAGPS::nmea_msg_t)':

C:\Users\Pmac\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.11\cores\arduino/avr/pgmspace.h:106:49: error: 'const void*' is not a pointer-to-object type

 #define pgm_read_ptr(addr) (*(const void *)(addr))

                                                 ^

C:\Users\Pmac\Documents\Arduino\libraries\NeoGPS\src\NMEAGPS.cpp:1997:37: note: in expansion of macro 'pgm_read_ptr'

       (const __FlashStringHelper *) pgm_read_ptr( &poll_msgs[msg-NMEA_FIRST_MSG] );

                                     ^

exit status 1
Error compiling for board Arduino Due (Programming Port).

I receive the same error using any of the provided examples. I've even opened a new sketch and #include <NEMAGPS.h> by its self and get the same error. Version 4.2.3 and older are the only stable versions that compile with no issues.

SlashDevin commented 6 years ago

This is actually an error in the Due core. :-/ I have added similar work-arounds for other platforms. I'll check in a new release shortly...

djholt commented 6 years ago

FYI: I applied this same fix for the Arduino 101 board (identified as ARDUINO_ARC32_TOOLS). Now it works great on this board!

SlashDevin commented 6 years ago

Thanks, I'll add it to the next update.