mikalhart / TinyGPSPlus

A new, customizable Arduino NMEA parsing library
http://arduiniana.org
1.08k stars 490 forks source link

problem with include header in a .h module #117

Closed alirezainallo closed 1 year ago

alirezainallo commented 1 year ago

hi i want to use a driver on this library. I'm using esp32 on platformIO. but when i call #include : image give me many error: image

but when call #include directly in my main.cpp every things are Ok and doesn't return these error. can you tell me why?🙏

mikalhart commented 1 year ago

@alirezainallo I'm guessing that because the file you are compiling (neo6GPS.c) is C, that your build is using the C compiler instead of the C++ compiler. TinyGPS++ requires C++ for concepts like 'public', 'friend', and 'class'. Maybe the solution is as simple as renaming neo6GPS.c to neo6GPS.cpp?

alirezainallo commented 1 year ago

@alirezainallo I'm guessing that because the file you are compiling (neo6GPS.c) is C, that your build is using the C compiler instead of the C++ compiler. TinyGPS++ requires C++ for concepts like 'public', 'friend', and 'class'. Maybe the solution is as simple as renaming neo6GPS.c to neo6GPS.cpp?

Thanks @mikalhart, my problem solved🙏🏻 Was exactly that neo6GPS file extention I change it to .cpp and solved.