程序编译出错SOS

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

程序编译出错SOS

#1

帖子 syfnet » 2009-09-16 15:55

安装一个程序,先./configure,再make,中间信息如下,问题出在什么地方?
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking auto silent in maintainer mode... auto-sleep-9
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for a BSD-compatible install... /usr/bin/install -c
checking for doxygen... no
checking for swig... no
checking for perl... /usr/bin/perl
checking for python... /usr/bin/python
configure: WARNING: Cannot find doxygen to build documentation.
Have a look at http://www.doxygen.org/
checking for a sed that does not truncate output... /bin/sed
checking for egrep... grep -E
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking how to run the C++ preprocessor... g++ -E
checking for g77... no
checking for f77... f77
checking whether we are using the GNU Fortran 77 compiler... yes
checking whether f77 accepts -g... yes
checking the maximum length of command line arguments... 32768
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if gcc static flag works... yes
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking for shl_load... no
checking for shl_load in -ldld... no
checking for dlopen... no
checking for dlopen in -ldl... yes
checking whether a program can dlopen itself... yes
checking whether a statically linked program can dlopen itself... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC
checking if g++ PIC flag -fPIC works... yes
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking for shl_load... (cached) no
checking for shl_load in -ldld... (cached) no
checking for dlopen... (cached) no
checking for dlopen in -ldl... (cached) yes
checking whether a program can dlopen itself... (cached) yes
checking whether a statically linked program can dlopen itself... (cached) yes
appending configuration tag "F77" to libtool
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for f77 option to produce PIC... -fPIC
checking if f77 PIC flag -fPIC works... yes
checking if f77 supports -c -o file.o... yes
checking whether the f77 linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... /usr/bin/f77: Illegal option: -print-search-dirs
GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking for asin in -lm... yes
checking for dlopen in -lc... no
checking for dlopen in -ldl... (cached) yes
checking for xml2-config... /usr/bin/xml2-config
checking for libxml - version >= 2.6.5... yes (version 2.6.32)
checking for GetINCHI in -linchi... no
checking if zlib is wanted... checking for inflateEnd in -lz... yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking iconv.h usability... yes
checking iconv.h presence... yes
checking for iconv.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for stdlib.h... (cached) yes
checking stdio.h usability... yes
checking stdio.h presence... yes
checking for stdio.h... yes
checking conio.h usability... no
checking conio.h presence... no
checking for conio.h... no
checking for string.h... (cached) yes
checking strstream.h usability... no
checking strstream.h presence... no
checking for strstream.h... no
checking iostream.h usability... no
checking iostream.h presence... no
checking for iostream.h... no
checking fstream.h usability... no
checking fstream.h presence... no
checking for fstream.h... no
checking math.h usability... yes
checking math.h presence... yes
checking for math.h... yes
checking time.h usability... yes
checking time.h presence... yes
checking for time.h... yes
checking ctype.h usability... yes
checking ctype.h presence... yes
checking for ctype.h... yes
checking iostream usability... yes
checking iostream presence... yes
checking for iostream... yes
checking fstream usability... yes
checking fstream presence... yes
checking for fstream... yes
checking sstream usability... yes
checking sstream presence... yes
checking for sstream... yes
checking strstream usability... yes
checking strstream presence... yes
checking for strstream... yes
checking whether time.h and sys/time.h may both be included... yes
checking for clock_t... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for rint... yes
checking for sranddev... no
checking for snprintf... yes
checking for strncasecmp... yes
checking whether scandir needs a const cast... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating data/Makefile
config.status: creating src/Makefile
config.status: creating src/math/Makefile
config.status: creating src/formats/Makefile
config.status: creating src/fingerprints/Makefile
config.status: creating src/formats/xml/Makefile
config.status: creating src/formats/inchi/Makefile
config.status: creating test/Makefile
config.status: creating test/cmltest/Makefile
config.status: creating tools/Makefile
config.status: creating doc/Makefile
config.status: creating scripts/Makefile
config.status: creating openbabel-2.0.pc
config.status: creating src/config.h
config.status: src/config.h is unchanged
config.status: executing depfiles commands
config.status: executing src/babelconfig.h commands
root@ubuntu:~/doc/DOVIS-2.0.1-installer/openbabel-2.0.2# make
Making all in data
make[1]: Entering directory `/root/doc/DOVIS-2.0.1-installer/openbabel-2.0.2/data'
make all-am
make[2]: Entering directory `/root/doc/DOVIS-2.0.1-installer/openbabel-2.0.2/data'
make[2]: Nothing to be done for `all-am'.
make[2]: Leaving directory `/root/doc/DOVIS-2.0.1-installer/openbabel-2.0.2/data'
make[1]: Leaving directory `/root/doc/DOVIS-2.0.1-installer/openbabel-2.0.2/data'
Making all in src
make[1]: Entering directory `/root/doc/DOVIS-2.0.1-installer/openbabel-2.0.2/src'
make all-recursive
make[2]: Entering directory `/root/doc/DOVIS-2.0.1-installer/openbabel-2.0.2/src'
Making all in math
make[3]: Entering directory `/root/doc/DOVIS-2.0.1-installer/openbabel-2.0.2/src/math'
if /bin/bash ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I../../src -I../../src -g -O2 -MT matrix3x3.lo -MD -MP -MF ".deps/matrix3x3.Tpo" -c -o matrix3x3.lo matrix3x3.cpp; \
then mv -f ".deps/matrix3x3.Tpo" ".deps/matrix3x3.Plo"; else rm -f ".deps/matrix3x3.Tpo"; exit 1; fi
mkdir .libs
g++ -DHAVE_CONFIG_H -I. -I. -I../../src -I../../src -g -O2 -MT matrix3x3.lo -MD -MP -MF .deps/matrix3x3.Tpo -c matrix3x3.cpp -fPIC -DPIC -o .libs/matrix3x3.o
In file included from ../../src/mol.h:51,
from matrix3x3.cpp:22:
../../src/data.h: In constructor 'OpenBabel::OBElement::OBElement(int, const char*, double, double, int, double, double, double, double, double, double, double, std::string)':
../../src/data.h:113: error: 'strncpy' was not declared in this scope
make[3]: *** [matrix3x3.lo] Error 1
make[3]: Leaving directory `/root/doc/DOVIS-2.0.1-installer/openbabel-2.0.2/src/math'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/root/doc/DOVIS-2.0.1-installer/openbabel-2.0.2/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/root/doc/DOVIS-2.0.1-installer/openbabel-2.0.2/src'
make: *** [all-recursive] Error 1
syfnet
帖子: 213
注册时间: 2009-07-13 16:23

Re: 程序编译出错SOS

#2

帖子 syfnet » 2009-09-17 9:46

初步估计是文件头的问题,与gCC4.3的升级有关,用cygwin可以安装(gcc3.4.4)。能不能在ubuntu里用gcc3.4而不用gcc4.3?
系统里既有gcc4.3,又有gcc3.4,如何让系统默认使用gcc3.4编译该程序?
syfnet
帖子: 213
注册时间: 2009-07-13 16:23

Re: 程序编译出错SOS

#3

帖子 syfnet » 2009-09-17 15:19

:em20
头像
cnkilior
论坛版主
帖子: 4984
注册时间: 2007-08-05 17:40

Re: 程序编译出错SOS

#4

帖子 cnkilior » 2009-09-17 15:28

configure CC=your_cc


see configure --help
syfnet
帖子: 213
注册时间: 2009-07-13 16:23

Re: 程序编译出错SOS

#5

帖子 syfnet » 2009-09-18 10:15

./configure CC=gcc3.4_cc

是这样吗?
头像
cnkilior
论坛版主
帖子: 4984
注册时间: 2007-08-05 17:40

Re: 程序编译出错SOS

#6

帖子 cnkilior » 2009-09-18 10:25

gcc3.4_cc
是你gcc3.4的名字吗?

具体还要看./configure --help中变量名的提示。

我举的例子只不过是比较普遍而已。
syfnet
帖子: 213
注册时间: 2009-07-13 16:23

Re: 程序编译出错SOS

#7

帖子 syfnet » 2009-09-19 10:24

用gcc --version看可以吗?
回复