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

Compilation failed, error: redefinition of 'struct mmsghdr #253

Open
DogRex opened this issue Oct 9, 2024 · 1 comment
Open

Compilation failed, error: redefinition of 'struct mmsghdr #253

DogRex opened this issue Oct 9, 2024 · 1 comment

Comments

@DogRex
Copy link

DogRex commented Oct 9, 2024

BufferSock.app 27行定义了结构体mmsghdr,但这个已经在x86_64-linux-gnu/sys/socket.h中定义了,报重复定义的错误

"root/software/ZLMediakit/3rdpart/2LToolkit/src/Network/Buffersock.cpp:27:8: error: redefinition of 'struct mmsghdr' struct mmsghdr In file included from/usr/include/netinet/in.h:23:0from /usr/include/netdb.h:27,from /root/software/ZLMediaKit/3rdpart/ZLToolKit/src/Network/sockutil.h:21from /root/software/ZLMediaKit/3rdpart/ZLToolKit/src/Network/BufferSock.h:27from /root/software/zLMediaKit/3rdpart/ZLToolKit/src/Network/BufferSock.cpp:12 usr/include/x86_64-linux-gnu/sys/socket.h:101:8:error: previous definition of 'struct mmsghdr' struct mmsghdr 3rdpart/CMakeFiles/zltoolkit.dir/build.make:185: recipe for target '3rdpart/cMakeFiles/zltoolkit.dir/ZLToolKit/src/Network/BufferSock.cpp.o' failed

image

Please ask how to solve this issue

BufferSock.app 27行定义了结构体mmsghdr,但这个已经在x86_64-linux-gnu/sys/socket.h中定义了,报重复定义的错误

"root/software/ZLMediakit/3rdpart/2LToolkit/src/Network/Buffersock.cpp:27:8: error: redefinition of 'struct mmsghdrstruct mmsghdr f In file included from/usr/include/netinet/in.h:23:0from /usr/include/netdb.h:27,from /root/software/ZLMediaKit/3rdpart/ZLToolKit/src/Network/sockutil.h:21from /root/software/ZLMediaKit/3rdpart/ZLToolKit/src/Network/BufferSock.h:27from /root/software/zLMediaKit/3rdpart/ZLToolKit/src/Network/BufferSock.cpp:12 usr/include/x86_64-linux-gnu/sys/socket.h:101:8:error: previous definition of 'struct mmsghdrstruct mmsghdr3rdpart/CMakeFiles/zltoolkit.dir/build.make:185: recipe for target '3rdpart/cMakeFiles/zltoolkit.dir/ZLToolKit/src/Network/BufferSock.cpp.o' failec

image

请问这个应该怎么解决

TRANS_BY_GITHUB_AI_ASSISTANT

@alexliyu7352 alexliyu7352 changed the title 编译时失败,error: redefinition of 'struct mmsghdr' Compilation failed, error: redefinition of 'struct mmsghdr Oct 9, 2024
@wasphin
Copy link
Member

wasphin commented Oct 9, 2024

Here is the translation of the text to English, preserving the existing formatting and punctuation:

Here it will first judge that it does not contain mmsghdr before defining

check_struct_has_member("struct mmsghdr" msg_hdr sys/socket.h HAVE_MMSG_HDR)

It seems that your side did not recognize it successfully, take a look at how it is defined in the system file

这里会先判断不包含 mmsghdr 才定义

check_struct_has_member("struct mmsghdr" msg_hdr sys/socket.h HAVE_MMSG_HDR)

看样子你那边没识别成功,看下系统文件中是怎么定义的

TRANS_BY_GITHUB_AI_ASSISTANT

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

No branches or pull requests

3 participants