open-im-server
open-im-server copied to clipboard
我用macos编译出错了,error: implicit declaration of function 'setresgid' is invalid in C99
环境 macos 10.15.7, idea 2021.3
build sdk报错了,大佬帮忙看看吧: Current directory: /Users/lixiaozhong/dev/gopath/src/Open-IM-Server/cmd/Open-IM-SDK-Core make build CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -o ws_wrapper/cmd/open_im_sdk_server ws_wrapper/cmd/open_im_sdk_server.go
linux_syscall.c:67:13: error: implicit declaration of function 'setresgid' is invalid in C99 [-Werror,-Wimplicit-function-declaration] linux_syscall.c:67:13: note: did you mean 'setregid'? /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/unistd.h:593:6: note: 'setregid' declared here linux_syscall.c:73:13: error: implicit declaration of function 'setresuid' is invalid in C99 [-Werror,-Wimplicit-function-declaration] linux_syscall.c:73:13: note: did you mean 'setreuid'? /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/unistd.h:595:6: note: 'setreuid' declared here make[1]: *** [build] Error 2 make: *** [install] Error 2
I meet the same question with you. Just resolved follow this: https://www.baifachuan.com/posts/4862a3b1.html
I meet the same question with you. Just resolved follow this: https://www.baifachuan.com/posts/4862a3b1.html
有用,修改后编译通过了
Linux is recommended
我和你遇到同样的问题。刚刚解决了这个:https ://www.baifachuan.com/posts/4862a3b1.html
有用,修改后编译通过了
你们到底怎么修改的啊,大佬们
怎么修改啊?
-
Install musl-cross brew install FiloSottile/musl-cross/musl-cross
-
Set build parameters CGO_ENABLED=1 GOOS=linux GOARCH=amd64 CC=x86_64-linux-musl-gcc CXX=x86_64-linux-musl-g++ ./batch_build_all_service.sh