Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: 'for' loop initial declaration used outside C99 mode #44

Open
MarcoRizz opened this issue Apr 28, 2022 · 3 comments
Open

error: 'for' loop initial declaration used outside C99 mode #44

MarcoRizz opened this issue Apr 28, 2022 · 3 comments

Comments

@MarcoRizz
Copy link

Hi, I'm trying to start with lvgl.
Following the README steps for Windows, at the execution in PlatformIO the output is the error

.pio\libdeps\emulator_64bits\lvgl\src\core\lv_obj.c: In function 'lv_obj_event':
.pio\libdeps\emulator_64bits\lvgl\src\core\lv_obj.c:734: error: 'for' loop initial declaration used outside C99 mode
*** [.pio\build\emulator_64bits\lib0e3\lvgl\core\lv_obj.o] Error 1
.pio\libdeps\emulator_64bits\lvgl\src\core\lv_refr.c: In function 'draw_buf_rotate_90':
.pio\libdeps\emulator_64bits\lvgl\src\core\lv_refr.c:825: error: 'for' loop initial declaration used outside C99 mode
.pio\libdeps\emulator_64bits\lvgl\src\core\lv_refr.c:829: error: 'for' loop initial declaration used outside C99 mode
.pio\libdeps\emulator_64bits\lvgl\src\core\lv_refr.c: In function 'draw_buf_rotate_90_sqr':
.pio\libdeps\emulator_64bits\lvgl\src\core\lv_refr.c:858: error: 'for' loop initial declaration used outside C99 mode
.pio\libdeps\emulator_64bits\lvgl\src\core\lv_refr.c:859: error: 'for' loop initial declaration used outside C99 mode
*** [.pio\build\emulator_64bits\lib0e3\lvgl\core\lv_refr.o] Error 1

Do I have to change some setting of PlatformIO?
Thanks

@puzrin
Copy link
Collaborator

puzrin commented Apr 28, 2022

No ideas. At least, CI pass https://github.com/lvgl/lv_platformio/actions/workflows/ci.yml

May be you have old compiler in your win? What env do you use?

@MarcoRizz
Copy link
Author

In VScode terminal at command g++ --version the output is

g++ --version
g++.exe (GCC) 4.2.1-sjlj (mingw32-2)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO 
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

even if MSYS2 is updated. I'm trying to fix it.

@puzrin
Copy link
Collaborator

puzrin commented Apr 29, 2022

Try to reproduce steps from CI config:

https://github.com/lvgl/lv_platformio/blob/master/.github/workflows/ci.yml#L80-L105

Probably, missed to sync something in readme. I have no windows to experiment with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants