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

编译demoui时关于serial_helper.c中#include "tkc/socket_helper.h"头文件包含的错误 #6

Open
meilizhongguo2 opened this issue Feb 20, 2024 · 1 comment

Comments

@meilizhongguo2
Copy link

meilizhongguo2 commented Feb 20, 2024

开发环境的具体配置:
windows系统版本:win11
android-studio-2023.1.1.28-windows
jdk-17_windows-x64_bin
android sdk的版本:android 14.0 API34
android ndk的版本:26.2.11394342

编译报错:

-MF CMakeFiles\awtk.dir\awtk\src\tkc\serial_helper.c.o.d -o CMakeFiles/awtk.dir/awtk/src/tkc/serial_helper.c.o -c D:/awtk-android/awtk-android/build/demoui/app/src/main/cpp/awtk/src/tkc/serial_helper.c
D:/awtk-android/awtk-android/build/demoui/app/src/main/cpp/awtk/src/tkc/serial_helper.c:1004:10: error: call to undeclared function 'tk_socket_wait_for_data'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  return tk_socket_wait_for_data(fd, timeout_ms);
         ^
1 error generated.

demoui/app/src/main/cpp/awtk/src/tkc/serial_helper.c第1004行: return tk_socket_wait_for_data(fd, timeout_ms);//该函数未声明导致报错
解决:

serial_helper.c的第40行:
#ifdef TK_IS_PC
#include "tkc/socket_pair.h"
#include "tkc/socket_helper.h"//将该行拿到宏外面去就可以解决问题,这里不明白的是TK_IS_PC宏未定义的情况下为什么引用了该头文件种的函数
#endif/*TK_IS_PC*/
@xianjimli
Copy link
Member

你更新AWTK再试试,谢谢。

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