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

使用Alpine镜像编译报错 error: unknown type name 'time_t'; did you mean 'size_t'? #1

Closed
worksg opened this issue Aug 20, 2019 · 3 comments

Comments

@worksg
Copy link

worksg commented Aug 20, 2019

报错信息如下

/chinadns-ng # make
gcc -std=c99 -Wall -Wextra -O3 -c chinadns.c -o chinadns.o
gcc -std=c99 -Wall -Wextra -O3 -c dnsutils.c -o dnsutils.o
gcc -std=c99 -Wall -Wextra -O3 -c maputils.c -o maputils.o
In file included from maputils.h:6,
                 from maputils.c:2:
netutils.h:43:22: error: unknown type name 'time_t'; did you mean 'size_t'?
 int new_once_timerfd(time_t second);
                      ^~~~~~
                      size_t
make: *** [Makefile:23: maputils.o] Error 1
/chinadns-ng # cat /etc/os-release 
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.9.3
PRETTY_NAME="Alpine Linux v3.9"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/"
/chinadns-ng # 

编译过程使用的命令

docker run -it --rm alpine sh

sed -i 's/dl-cdn.alpinelinux.org/mirrors.huaweicloud.com/g' /etc/apk/repositories

apk add build-base git

git clone https://github.com/zfl9/chinadns-ng

cd chinadns-ng

make # 这步报错

make install
@zfl9
Copy link
Owner

zfl9 commented Aug 21, 2019

应该是忘了导入time.h,我待会加上去

@zfl9
Copy link
Owner

zfl9 commented Aug 21, 2019

更新到我最新的提交,再试,应该可以了。

@zfl9 zfl9 closed this as completed Aug 21, 2019
@zfl9 zfl9 reopened this Aug 21, 2019
@worksg
Copy link
Author

worksg commented Aug 21, 2019

刚才试了下最新的commit,确实可以正常编译了. 感谢作者!

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