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
What does 'go version' print?
go version go1.4rc1 linux/amd64
What steps reproduce the problem?
Change from go 1.3.3 -> go 1.4rc1 .
Compiling a package with an unused .c file generates an error.
Create a package with condition compilation (x_linux.go, x_windows.go).
src/foo/foo_linux.go
src/foo/foo_windows.go
src/foo/foo.h
src/foo/foo.c // compiled for windows only
In this case, the linux version is 'stubbed' out and does not use cgo. The Windows
version uses cgo
What happened?
can't load package: package foo: C source files not allowed when not using cgo: foo.c
What should have happened instead?
Should not fail.
Please provide any additional information below.
Workaround
Rename the .c file foo_windows.c or add a // +build windows condition to the top of the
.c file.
Should this be documented somewhere?
The text was updated successfully, but these errors were encountered:
this is documented in release notes for 1.4:
http://tip.golang.org/doc/go1.4#gocmd
Unless cgo is being used to build the package, the go command now refuses to compile C
source files, since the relevant C compilers (6c etc.) are intended to be removed from
the installation in some future release. (They are used today only to build part of the
runtime.) It is difficult to use them correctly in any case, so any extant uses are
likely incorrect, so we have disabled them.
by joshua.boelter:
The text was updated successfully, but these errors were encountered: