[新手求助]gcc编译问题

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
ubung
帖子: 1
注册时间: 2014-09-02 13:38
系统: ubuntu14.04

[新手求助]gcc编译问题

#1

帖子 ubung » 2014-09-02 14:01

最近开始学习Linux,准备搭建Graphviz + CodeViz环境用于分析代码框架。
系统为:Ubuntu14.04 LTS
按照 http://www.cnblogs.com/lanxuezaipiao/p/3450201.html 的步骤进行安装,可是中间总是出现如下错误:

代码: 全选

../../gcc-4.6.2/libiberty/fibheap.c: In function ‘fibheap_replace_key_data’:
../../gcc-4.6.2/libiberty/fibheap.c:220:30: error: ‘LONG_MIN’ undeclared (first use in this function)
../../gcc-4.6.2/libiberty/fibheap.c:220:30: note: each undeclared identifier is reported only once for each function it appears in
../../gcc-4.6.2/libiberty/fibheap.c: In function ‘fibheap_delete_node’:
../../gcc-4.6.2/libiberty/fibheap.c:261:36: error: ‘LONG_MIN’ undeclared (first use in this function)
../../gcc-4.6.2/libiberty/fibheap.c:265:7: warning: implicit declaration of function ‘abort’ [-Wimplicit-function-declaration]
../../gcc-4.6.2/libiberty/fibheap.c:265:7: warning: incompatible implicit declaration of built-in function ‘abort’ [enabled by default]
../../gcc-4.6.2/libiberty/fibheap.c: In function ‘fibheap_delete’:
../../gcc-4.6.2/libiberty/fibheap.c:277:5: warning: incompatible implicit declaration of built-in function ‘free’ [enabled by default]
../../gcc-4.6.2/libiberty/fibheap.c: In function ‘fibheap_consolidate’:
../../gcc-4.6.2/libiberty/fibheap.c:368:3: warning: implicit declaration of function ‘memset’ [-Wimplicit-function-declaration]
../../gcc-4.6.2/libiberty/fibheap.c:368:3: warning: incompatible implicit declaration of built-in function ‘memset’ [enabled by default]
make[3]: *** [fibheap.o] Error 1
make[3]: Leaving directory `/usr/local/codeviz-1.0.12/compilers/gcc-graph/objdir/libiberty'
make[2]: *** [all-stage2-libiberty] Error 2
make[2]: Leaving directory `/usr/local/codeviz-1.0.12/compilers/gcc-graph/objdir'
make[1]: *** [stage2-bubble] Error 2
make[1]: Leaving directory `/usr/local/codeviz-1.0.12/compilers/gcc-graph/objdir'
make: *** [all] Error 2

Compile saved after trying to fix up config.h, do not know what to do
This is likely a CodeViz rather than a gcc problem
初步怀疑是环境的问题。
但是对于陌生的Linux环境,是一头雾水,哪位大侠能出手相助下,告诉下解决思路。
taohunter
帖子: 1555
注册时间: 2012-03-31 3:29

Re: [新手求助]gcc编译问题

#2

帖子 taohunter » 2014-09-02 17:24

你能首先回答我为什么不按照你自己提供的那个链接中说的“如果是Ubuntu系统可以直接apt安装: sudo apt-get install graphviz”这种方式安装该软件,而非要用自己编译的方式安装吗?

另外你自己安装的时候是否又忽略了文中的这两句话:
“注1:不需要 make ”
“注意:这里为什么不是通常用的make install“

按照我的猜测,既然你能忽略最简单的安装方式,估计十有八九也忽略了这两句。。。

“但是对于陌生的Linux环境,是一头雾水,哪位大侠能出手相助下,告诉下解决思路。”--下面就是“思路”:

按下ctrl+alt+t组合键,打开一个终端窗口,然后在终端窗口中输入以下命令并执行:

代码: 全选

sudo apt-get install graphviz
三年后终于回到16.04--稳定了!
cheeselee
帖子: 353
注册时间: 2008-07-09 0:39

Re: [新手求助]gcc编译问题

#3

帖子 cheeselee » 2014-10-11 21:48

我也遇到的同样的问题

把 install_gcc-4.6.2.sh 这两行修改一下就能让这里构建通过,主要是添加 --disable-bootstrap
-../gcc-4.6.2/configure --prefix=$INSTALL_PATH --enable-shared --enable-languages=c,c++ || exit
-make bootstrap
+CFLAGS="-O2 -fPIC" ../gcc-4.6.2/configure --prefix=$INSTALL_PATH --disable-bootstrap --enable-shared --enable-languages=c,c++ || exit
+make -j 4
回复