英文:
gccgo linking Error in Ubuntu 9.10 karmic?
问题
我正在尝试使用gccgo编译go文件,我已经在我的Ubuntu 9.10机器上安装了它。当我编译时,
$gccgo -c hello.go
生成了hello.o文件,但在尝试链接并形成可执行文件时,
$gccgo -o hello hello.o
我得到了以下错误
/usr/local/lib/gcc/i686-pc-linux-gnu/4.5.0/../../../libgo.so: undefined reference to `__sync_fetch_and_add_4'
/usr/local/lib/gcc/i686-pc-linux-gnu/4.5.0/../../../libgo.so: undefined reference to `__sync_bool_compare_and_swap_4'
collect2: ld returned 1 exit status
我是否漏掉了什么?我也在我的环境中设置了LD_LIBRARY_PATH。谢谢
英文:
I am trying to compile go file using gccgo , i installed on my ubuntu 9.10 machine . when i compiled
$gccgo -c hello.go
hello.o file is generated , while trying to link and to form an executable
$gccgo -o hello hello.o
i get the following error
/usr/local/lib/gcc/i686-pc-linux-gnu/4.5.0/../../../libgo.so: undefined reference to `__sync_fetch_and_add_4'
/usr/local/lib/gcc/i686-pc-linux-gnu/4.5.0/../../../libgo.so: undefined reference to `__sync_bool_compare_and_swap_4'
collect2: ld returned 1 exit status
Am i missing something ? , i have also set my LD_LIBRARY_PATH in my environment . Thanks
答案1
得分: 0
也许可以尝试按照<a href="http://sourceware.org/ml/libc-alpha/2007-02/msg00009.html">这篇帖子</a>中的建议,并将<code>-march=i486</code>传递给编译器?(或者<code>-march=i686</code>)
英文:
Maybe try following the advice in <a href="http://sourceware.org/ml/libc-alpha/2007-02/msg00009.html"> this post </a> and pass <code>-march=i486</code> to the compiler? (or <code>-march=i686</code>)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论