25

I was using Go 1.3.3. After installing 1.4, there are many errors similar to this:

db/base.go:4: import /home/asd/Dropbox/go/pkg/linux_amd64/projc1/libs/Bool.a: 
 object is [linux amd64 go1.3.3 X:precisestack] 
  expected [linux amd64 go1.4 X:precisestack]

How do I resolve this? I've tried go build on $GOPATH/src/projc1/libs/Bool/ but it has no effect.

Rick-777
  • 8,290
  • 5
  • 31
  • 47
Kokizzu
  • 20,659
  • 24
  • 107
  • 195

2 Answers2

27

You're probably looking for go build -a to force rebuilding of existing packages.

dyoo
  • 10,955
  • 1
  • 29
  • 41
12

Ah I see, removing /home/asd/Dropbox/go/pkg/linux_amd64/projc1/ would solve this problem.

Kokizzu
  • 20,659
  • 24
  • 107
  • 195
  • 9
    I deleted all intermediate build files by running `rm -rf $GOPATH/pkg`. It worked for me, but run `rm -rf` with care. – Cerise Limón Dec 16 '14 at 06:21
  • 3
    Removing already compiled packages will solve the error message, but the packages are not recompiled automatically so every 'go build' recompiles every package. 'go install' should compile and save the package for later reuse. – siritinga Dec 16 '14 at 11:46