Error: "C source files not allowed when using cgo:....."

94 views
Skip to first unread message

Hartmut König

unread,
Apr 8, 2015, 4:16:13 PM4/8/15
to gocl...@googlegroups.com
Hi folks,

i am trying to configure my workspace in eclipse for go-development.
After setting the GOPATH, i get the error message at building a sample go-file:

***************** Building Go workspace ******************
>> Running: /usr/local/bin/go install -v -gcflags -N -l ./...
     with GOPATH: /workspace
package testing
       imports runtime: C source files not allowed when not using cgo: atomic_amd64x.c defs.c float.c headdump.c lfstack.c malloc.c mcache.c
     ^^^ Terminated, exit code: 1 ^^^ 
***************** Build terminated. *****************

Any hint would be appreciated.

Hartmut

Hartmut König

unread,
Apr 13, 2015, 4:19:45 PM4/13/15
to gocl...@googlegroups.com
Anybody here?

brunomedeiros

unread,
Apr 15, 2015, 7:35:04 AM4/15/15
to gocl...@googlegroups.com
I have no idea why that error happens. Did you try a simple Go workspace with just a Hello World? What are the contents of the package "testing" ? (Note that Goclipse will try to build the entire GOPATH, so maybe it's building other packages you don't it to?)

Hartmut König

unread,
Apr 26, 2015, 7:50:34 AM4/26/15
to gocl...@googlegroups.com
hi,

thanks for the response.

Well, i isolated the libdir into my workdir, so i got another error: 

************  Building Go workspace  ************

-------   Building Go project: Test-Projekt  -------

>> Running: /usr/local/bin/go install -v -gcflags -N -l ./...

   with GOPATH: /Users/harty/Documents/workspace_new/Test-Projekt:/Users/harty/Documents/workspace_new/Test-Projekt/src

runtime

go tool: no such tool "6g"

   ^^^ Terminated, exit code: 3 ^^^

************  Build terminated.  ************

This is my src:

package testing


import "fmt"


func main() {

     fmt.Println("Hello");

Any hint?

thanks

hartmut


Am Mittwoch, 8. April 2015 22:16:13 UTC+2 schrieb Hartmut König:

brunomedeiros

unread,
May 8, 2015, 8:21:44 AM5/8/15
to gocl...@googlegroups.com, weic...@gmail.com
No idea, but is this even a Goclipse related issue? If you have the same problem whilst invoking go install in the command line (with the same env vars), then it should a Go toolchain issue. Better to ask in to Go user newsgroups about it


On Wednesday, 8 April 2015 21:16:13 UTC+1, Hartmut König wrote:

Hartmut König

unread,
May 12, 2015, 5:21:16 AM5/12/15
to gocl...@googlegroups.com
Hi Bruno,

just tried to get it running, on commandline it works... i check the go-folks.

thanks.

h.


Am Mittwoch, 8. April 2015 22:16:13 UTC+2 schrieb Hartmut König:

christop...@gmail.com

unread,
Jul 1, 2015, 10:35:38 AM7/1/15
to gocl...@googlegroups.com
I don't know if you have solved this problem. But I ran into precisely the same problem.

In my case, in the default configuration of the Goclipse, $GOROOT was pointing to /usr/ ! Thus go was trying to compile the Linux header files (in /usr/src), hence the error message.

I simply had to select /usr/lib/go for $GOROOT (preferences -> go).

All the Best,

C.
Reply all
Reply to author
Forward
0 new messages