When net package is imported building binary with CGO generate error

256 views
Skip to first unread message

sbezverk

unread,
Nov 2, 2023, 10:21:53 AM11/2/23
to golan...@googlegroups.com

 

 

Hello,

 

I came across a situation when “net” package is imported regardless directly or indirectly via another package, go build generates these errors:

 

/sw/packages/go/1.19.4/src/net/cgo_linux.go:20:59: could not determine kind of name for C.AI_ALL

/sw/packages/go/1.19.4/src/net/cgo_linux.go:20:43: could not determine kind of name for C.AI_V4MAPPED

 

I could not find any clues on the internet, curious if somebody saw similar issue and somehow has fixed it.

 

Thank you

Serguei

Vladimir Varankin

unread,
Nov 3, 2023, 5:04:08 AM11/3/23
to golang-nuts
Hey there,

Which OS (Linux distro) you're using? As far as I can see from cgo_linix.go [1], the constants, that trigger an error, should come from the "netdb.h", which comes with libc.

Reply all
Reply to author
Forward
0 new messages