TeensyTimerTool icon indicating copy to clipboard operation
TeensyTimerTool copied to clipboard

error: expected '{' before '::' token

Open bblanchon opened this issue 2 years ago • 5 comments

Hi @luni64,

I'm having the following error when compiling with arduino-cli:

In file included from /home/runner/Arduino/libraries/TeensyTimerTool/src/TimerModules/RTC/RTC.cpp:3:0:
/home/runner/Arduino/libraries/TeensyTimerTool/src/TimerModules/RTC/RTC.h:[5](https://github.com/bblanchon/ArduinoContinuousStepper/actions/runs/5952260840/job/16143840558#step:10:6):2[6](https://github.com/bblanchon/ArduinoContinuousStepper/actions/runs/5952260840/job/16143840558#step:10:7): error: expected '{' before '::' token
 namespace TeensyTimerTool::RTC_t
                          ^
/home/runner/Arduino/libraries/TeensyTimerTool/src/TimerModules/RTC/RTC.h:5:2[8](https://github.com/bblanchon/ArduinoContinuousStepper/actions/runs/5952260840/job/16143840558#step:10:9): error: 'RTC_t' in namespace '::' does not name a type
 namespace TeensyTimerTool::RTC_t
                            ^
/home/runner/Arduino/libraries/TeensyTimerTool/src/TimerModules/RTC/RTC.cpp:6:26: error: expected '{' before '::' token
 namespace TeensyTimerTool::RTC_t
                          ^
/home/runner/Arduino/libraries/TeensyTimerTool/src/TimerModules/RTC/RTC.cpp:6:28: error: 'RTC_t' in namespace '::' does not name a type
 namespace TeensyTimerTool::RTC_t
                            ^
/home/runner/Arduino/libraries/TeensyTimerTool/src/TimerModules/RTC/RTC.cpp:32:1: error: expected '}' at end of input
 } // namespace TeensyTimerTool::RTC_t
 ^
/home/runner/Arduino/libraries/TeensyTimerTool/src/TimerModules/RTC/RTC.cpp:32:1: error: expected '}' at end of input

Error during build: exit status 1

Nested namespace definitions require C++17; I think it's a bit too early for that.

Best regards, Benoit

bblanchon avatar Aug 23 '23 14:08 bblanchon

Dear @luni64

Same issue here!

The code used to work fine some months ago. Now, my project is broken and won't compile:

image

as @bblanchon mentioned is this related to C++17 features?

dzalf avatar Oct 31 '23 17:10 dzalf

Guy, I think I spoke too fast. 😞

I was using an old version of the library. After updating it to 1.4.1 in my platformio project, the code compiles fine

luni64/TeensyTimerTool@^1.4.1 yields:

image

dzalf avatar Oct 31 '23 17:10 dzalf

luni64 is right might be broke: none of the github examples compile: all give this same error. TeensyTimerTool\src\TimerModules/RTC/RTC.h:5:26: error: expected '{' before '::' token namespace TeensyTimerTool::RTC_t

us866 avatar Nov 04 '23 11:11 us866

tried 1.4.1 and 1.4.0 library

us866 avatar Nov 04 '23 11:11 us866

Please see here: https://forum.pjrc.com/index.php?threads/teensy-timer-tools-error.73494/post-331340

luni64 avatar Nov 09 '23 04:11 luni64