You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to solve 40988# by compiling the file at Ubuntu WSL, Ubuntu inside Windows 10.
I got go installed and running:
$ go version
go version go1.15 linux/amd64
I got gcc installed and running
While compiling the same code, I got the below error:
output:
# command-line-arguments
/usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/tmp/go-link-178415548/go.o:(.data+0x0): undefined reference to `x_cgo_callers'/tmp/go-link-178415548/go.o:(.data+0x8): undefined reference to `x_cgo_init'/tmp/go-link-178415548/go.o:(.data+0x10): undefined reference to `x_cgo_mmap'/tmp/go-link-178415548/go.o:(.data+0x18): undefined reference to `x_cgo_munmap'
/tmp/go-link-178415548/go.o:(.data+0x20): undefined reference to `x_cgo_notify_runtime_init_done'/tmp/go-link-178415548/go.o:(.data+0x28): undefined reference to `x_cgo_sigaction'/tmp/go-link-178415548/go.o:(.data+0x30): undefined reference to `x_cgo_thread_start'/tmp/go-link-178415548/go.o:(.data+0x38): undefined reference to `x_cgo_setenv'
/tmp/go-link-178415548/go.o:(.data+0x40): undefined reference to `x_cgo_unsetenv'/tmp/go-link-178415548/go.o:(.data+0x48): undefined reference to `_cgo_yield'collect2: error: ld returned 1 exit status
The text was updated successfully, but these errors were encountered:
Please show us text as plain text, not as an image. Thanks.
First, you need to set CGO_ENABLED=1. But that won't be enough: in order to cross-compile a Go program that uses C code, you need to have a C cross-compiler. Go cross-compiles automatically, but C does not.
Closing because this is not a bug. We don't use the issue tracker for questions. You will get better and faster help using a forum. Please see https://golang.org/wiki/Questions. Thanks.
I tried to solve 40988# by compiling the file at Ubuntu WSL, Ubuntu inside Windows 10.
I got go installed and running:
I got gcc installed and running

While compiling the same code, I got the below error:
The text was updated successfully, but these errors were encountered: