-
Notifications
You must be signed in to change notification settings - Fork 181
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
bindings undefined: Message #238
Comments
I'm inclined to believe that this is a Windows-specific problem with Go compiler. Did you try different versions? Both latest 1.23.3 and something pre-1.23? I've tried a minimalist snippet that calls blst.Uniq and it works fine with 1.23.3 and 1.21.5... As in
Another possibility is interference with your antivirus. Race conditions introduced by its activity are not unheard of, nor the possibility that it has aversion to the whatever you try to do. For example I had .dll-s generated by Go compiler removed... |
Getting the same error message when attempting to compile a Go project on Linux 5.15 Tried running the small program above with blst versions 0.13.11 and 0.13.3 and getting the same error # github.com/supranational/blst/bindings/go
../go/pkg/mod/github.com/supranational/blst@v0.3.13/bindings/go/rb_tree.go:130:18: undefined: Message |
Well, what can I say? In order to at the very least reason about a problem, I have to reproduce it. And I can't. As for reference to "Linux 5.15" I've never seen and even fail to imagine that a failure to compile a specific module but not a slew of others would depend on the Linux kernel version. I mean I interpret the reference as suggestion that the failure depends specifically on it. But all right, I can confirm that I can't reproduce it even with this specific kernel version. Not really surprising, because all a compiler, be it Go |
The kernel version is mostly unimportant, other than the related glibc version it has I suppose, I just wanted to note that this happened to me on a Linux server since you had said this was a Windows-specific problem, it's not. It's a C/C++ compiler related issue. |
Hmm... How is it possible? The error does not involve C.go interface. Indeed, rb_tree.go makes no C.go calls and Message is a pure Go type, []byte...
From which? I've just tried with gcc 5.4, and it worked... |
It seems this issue only shows up when a C compiler is not installed on the host system. It makes sense that the bindings wouldn't work without a C compiler since this library is written in C, but this is a very odd error to get if cgo can not find a C compiler. |
Wow! Speaking of a blind spot :-) It boils down to the README issue, "To compile on Windows one has to have MinGW gcc on the Just in case for reference. Why gcc and not a C compiler. gcc is the explicitly pre-defined default. It can be overridden with a compatible replacement, but it's assumed that those who do know what they are doing. Also for reference. Since it's specifically MinGW gcc on Windows, it's appropriate to mention how to verify that it's in fact a suitable one. |
Correction. This is not universally true. It's the default for Linux and Windows packages, at least [for] ones downloaded from go.dev. Others default to cc and even clang. A note of caution in the context. clang for Windows comes in many flavours. One that would be suitable for go has to meet the same criteria as gcc. |
When running go test with my codebase.
Platform: go version go1.23.1 windows/amd64 (windows 11)
Confirmed working on Linux and Mac osx.
The text was updated successfully, but these errors were encountered: