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

use extern "C" for sys_now() to fix compile/linking errors #286

Open
wants to merge 1 commit into
base: feature/realtek-update
Choose a base branch
from

Conversation

shilga
Copy link

@shilga shilga commented Jun 2, 2024

fixes compiling/linking errors in esphome. I was using esphome 2024.5.4

@kuba2k2
Copy link
Member

kuba2k2 commented Jun 2, 2024

Can you show where the linking error is and what component uses the sys_now? I don't remember having such an issue in ESPHome.

@shilga
Copy link
Author

shilga commented Jun 2, 2024

sure

Compiling .pioenvs/klarstein-kraftwerk/libc11/AsyncTCP-esphome/AsyncTCP.cpp.o
Compiling .pioenvs/klarstein-kraftwerk/libf53/ESPAsyncWebServer-esphome/AsyncEventSource.cpp.o
In file included from /data/cache/platformio/packages/library-lwip/src/include/lwip/timeouts.h:44,
                 from /data/cache/platformio/packages/library-lwip/src/include/lwip/tcpip.h:45,
                 from /data/cache/platformio/packages/library-lwip/src/include/lwip/priv/tcpip_priv.h:44,
                 from .piolibdeps/klarstein-kraftwerk/AsyncTCP-esphome/src/AsyncTCP.cpp:369:
/data/cache/platformio/packages/library-lwip/src/include/lwip/sys.h:447:7: error: conflicting declaration of 'u32_t sys_now()' with 'C' linkage
  447 | u32_t sys_now(void);
      |       ^~~~~~~
In file included from /data/cache/platformio/packages/library-lwip/src/include/lwip/opt.h:51,
                 from /data/cache/platformio/packages/library-lwip/src/include/lwip/ip_addr.h:40,
                 from .piolibdeps/klarstein-kraftwerk/AsyncTCP-esphome/src/AsyncTCP.h:28,
                 from .piolibdeps/klarstein-kraftwerk/AsyncTCP-esphome/src/AsyncTCP.cpp:24:
/data/cache/platformio/platforms/libretiny@src-91da51c6060519855d39a90bec721fde/cores/realtek-ambz2/base/config/lwipopts.h:10:22: note: previous declaration with 'C++' linkage
   10 | extern unsigned long sys_now(void);
      |                      ^~~~~~~
*** [.pioenvs/klarstein-kraftwerk/libc11/AsyncTCP-esphome/AsyncTCP.cpp.o] Error 1

See also full log in attachment
logs_klarstein-kraftwerk_compile.txt

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

Successfully merging this pull request may close these issues.

None yet

2 participants