英文:
gccgo does not know -fgo-relative-import-path
问题
我试图在我的机器上使用gccgo编译一些代码:
$ export LANG=C
$ go get -d github.com/fuzxxl/ppm
$ cd $GOPATH/src/github.com/fuzxxl/ppm
$ go build -compiler gcc
gccgo: error: unrecognized command line option '-fgo-relative-import-path=_/home/fuz/src/go/src/github.com/fuzxxl/ppm'
这是我机器上的工具:
$ go version
go version devel +dda87c8bcba1 Wed Apr 17 13:25:28 2013 -0700 linux/amd64
$ gccgo --version
gccgo (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
为什么会出现上面显示的错误?我该怎么解决这个问题?
英文:
I tried to compile some code with gccgo on my machine:
$ export LANG=C
$ go get -d github.com/fuzxxl/ppm
$ cd $GOPATH/src /github.com/fuzxxl/ppm
$ go build -compiler gcc
gccgo: error: unrecognized command line option '-fgo-relative-import-path=_/home/fuz/src/go/src/github.com/fuzxxl/ppm'
These are the tools on my machine:
$ go version
go version devel +dda87c8bcba1 Wed Apr 17 13:25:28 2013 -0700 linux/amd64
$ gccgo --version
gccgo (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Why do I get the error shown above? What can I do to fix this?
答案1
得分: 2
-fgo-relative-import-path
选项是在2012年10月30日提交的(http://gcc.gnu.org/ml/gcc-patches/2012-10/msg02841.html),而GCC 4.7.2(包括gccgo)已经在2012年09月20日发布(http://gcc.gnu.org/gcc-4.7/)。所以gccgo 4.7.2目前还不支持这个选项。
升级gccgo到4.7.3(或4.8.0)应该可以解决这个问题。
英文:
The -fgo-relative-import-path
option was committed on 2012-10-30, whereas GCC 4.7.2 (including gccgo) was already released on 2012-09-20. So gccgo 4.7.2 simply does not yet contain support for this option.
Upgrading gccgo to 4.7.3 (or 4.8.0) should fix this.
答案2
得分: 0
"Raring Ringtail" 是 Ubuntu 13.04 的代号,计划于2013年4月25日发布。
GNU Go 编译器:软件包(raring):gccgo-4.7(4.7.3-1ubuntu1)
在此期间,我正在使用 Ubuntu 13.04(Raring Ringtail)每日构建版。
例如,
$ uname -a
Linux ubuntu 3.8.0-19-generic #29-Ubuntu SMP Wed Apr 17 18:16:28 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
$ gccgo --version
gccgo (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3
$ export GOPATH=/home/peter/gopath
$ export LANG=C
$ go get -d github.com/fuzxxl/ppm
$ cd $GOPATH/src/github.com/fuzxxl/ppm
$ go build -compiler gccgo
$ go install -compiler gccgo
$
英文:
> "Raring Ringtail" is the code name for Ubuntu 13.04, scheduled
> for release on 25 April 2013.
GNU Go compiler: Package (raring): gccgo-4.7 (4.7.3-1ubuntu1)
In the interim, I'm using the Ubuntu 13.04 (Raring Ringtail) Daily Build.
For example,
$ uname -a
Linux ubuntu 3.8.0-19-generic #29-Ubuntu SMP Wed Apr 17 18:16:28 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
$ gccgo --version
gccgo (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3
$ export GOPATH=/home/peter/gopath
$ export LANG=C
$ go get -d github.com/fuzxxl/ppm
$ cd $GOPATH/src/github.com/fuzxxl/ppm
$ go build -compiler gccgo
$ go install -compiler gccgo
$
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论