socklen_t : undeclared identifier

本文提供了解决使用VC6.0编译时遇到的错误的步骤,并指导如何正确安装SDK来避免这些问题。通过设置特定目录路径,用户能够顺利地配置其开发环境,解决编译警告和错误。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

错误:

d:\wpdpack\examples-pcap\iflist\iflist.c(152) : error C2065: 'socklen_t' : undeclared identifier
d:\wpdpack\examples-pcap\iflist\iflist.c(152) : error C2146: syntax error : missing ';' before identifier 'sockaddrlen'
d:\wpdpack\examples-pcap\iflist\iflist.c(152) : error C2065: 'sockaddrlen' : undeclared identifier
d:\wpdpack\examples-pcap\iflist\iflist.c(161) : warning C4013: 'getnameinfo' undefined; assuming extern returning int
d:\wpdpack\examples-pcap\iflist\iflist.c(167) : error C2065: 'NI_NUMERICHOST' : undeclared identifier
Error executing cl.exe.

 

编译器为: VC6.0

解决方法:

安装SDK,

并在菜单Tools --> Options --> Directories 中设置: (置顶)

C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\MICROSOFT SDK\INCLUDE

C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\MICROSOFT SDK\LIB

 

转于:

http://blog.163.com/gaoguangtao_love/blog/static/384837152009725111213939/

root@ubuntu:/home/wuju/project/did-zkp-gnark# make go mod tidy go build -buildmode=c-archive -o zkproof.a zkproof.go gcc -o client client.c zkproof.a \ -I/home/wuju/xquic/include -I. \ -L/home/wuju/xquic/build -L/home/wuju/xquic/third_party/boringssl/build \ -lxquic-static -lssl -lcrypto -lpthread -lm -lstdc++ client.c: In function ‘main’: client.c:61:28: error: too few arguments to function ‘xqc_engine_create’ xqc_engine_t *engine = xqc_engine_create(XQC_ENGINE_CLIENT, NULL, NULL, NULL); ^~~~~~~~~~~~~~~~~ In file included from client.c:9:0: /home/wuju/xquic/include/xquic/xquic.h:1613:15: note: declared here xqc_engine_t *xqc_engine_create(xqc_engine_type_t engine_type, ^~~~~~~~~~~~~~~~~ client.c:77:30: warning: implicit declaration of function ‘xqc_engine_connect’; did you mean ‘xqc_engine_create’? [-Wimplicit-function-declaration] xqc_connection_t *conn = xqc_engine_connect( ^~~~~~~~~~~~~~~~~~ xqc_engine_create client.c:77:30: warning: initialization makes pointer from integer without a cast [-Wint-conversion] client.c:89:28: warning: implicit declaration of function ‘xqc_conn_create_stream’; did you mean ‘xqc_conn_create_path’? [-Wimplicit-function-declaration] xqc_stream_t *stream = xqc_conn_create_stream(conn, XQC_STREAM_BIDI, 0); ^~~~~~~~~~~~~~~~~~~~~~ xqc_conn_create_path client.c:89:28: warning: initialization makes pointer from integer without a cast [-Wint-conversion] client.c:104:68: error: ‘XQC_FIN’ undeclared (first use in this function); did you mean ‘MSG_FIN’? xqc_stream_send(stream, (char*)&header, sizeof(MessageHeader), XQC_FIN); ^~~~~~~ MSG_FIN client.c:104:68: note: each undeclared identifier is reported only once for each function it appears in Makefile:16: recipe for target 'build' failed make: *** [build] Error 1
最新发布
07-25
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值