2009-11-20 09:10

gccgo在Ubuntu 9.10 karmic中链接错误?


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/../../../ undefined reference to `__sync_fetch_and_add_4'
/usr/local/lib/gcc/i686-pc-linux-gnu/4.5.0/../../../ 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

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答


  • dongpan2788 dongpan2788 12年前

    Maybe try following the advice in this post and pass -march=i486 to the compiler? (or -march=i686)

    点赞 评论 复制链接分享