编译cscope-15.8a遇到的问题与解决方案

来源:互联网 发布:快递软件是什么 编辑:程序博客网 时间:2024/06/14 23:12

1)环境

主机:Linux ubuntu 3.2.0-32-generic-pae #51-Ubuntu SMP Wed Sep 26 21:54:23 UTC 2012 i686 i686 i386 GNU/Linux

cscope版本:15.8a

2)遇到的问题:

1.build.c:52:20: 致命错误: curses.h:没有那个文件或目录;
2.解决问题前面,链接不通过;
3.安装失败;

3)解决方案:

1.安装 libncurses5-dev ,sudo apt-get install ncurses-dev
2.重头配置编译,./configure > make > sudo make install
3.sudo make install

4)细节说明与记录

查看curses相关的lib,发现确实没有安装libncurses5-dev
ii  libncurses5                                  5.9-4                                            shared libraries for terminal handlingii  libncurses5:i386                             5.9-4                                            shared libraries for terminal handlingii  libncursesw5                                 5.9-4                                            shared libraries for terminal handling (wide character support)ii  libncursesw5:i386                            5.9-4                                            shared libraries for terminal handling (wide character support)ii  mtr-tiny                                     0.80-1ubuntu1                                    Full screen ncurses traceroute toolii  ncurses-base                                 5.9-4                                            basic terminal type definitionsii  ncurses-bin                                  5.9-4                                            terminal-related programs and man pages

安装libncurses5-dev
luogw@luogw-ThinkPad-Edge:~$ sudo apt-get install ncurses-dev[sudo] password for luogw: 正在读取软件包列表... 完成正在分析软件包的依赖关系树       正在读取状态信息... 完成       注意,选取 libncurses5-dev 而非 ncurses-dev将会安装下列额外的软件包:  libtinfo-dev建议安装的软件包:  ncurses-doc下列【新】软件包将被安装:  libncurses5-dev libtinfo-dev升级了 0 个软件包,新安装了 2 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。需要下载 325 kB 的软件包。解压缩后会消耗掉 1,623 kB 的额外空间。您希望继续执行吗?[Y/n]Y获取:1 http://cn.archive.ubuntu.com/ubuntu/ precise/main libtinfo-dev amd64 5.9-4 [103 kB]获取:2 http://cn.archive.ubuntu.com/ubuntu/ precise/main libncurses5-dev amd64 5.9-4 [222 kB]下载 325 kB,耗时 3秒 (99.5 kB/s)         Selecting previously unselected package libtinfo-dev.(正在读取数据库 ... 系统当前共安装有 185922 个文件和目录。)正在解压缩 libtinfo-dev (从 .../libtinfo-dev_5.9-4_amd64.deb) ...Selecting previously unselected package libncurses5-dev.正在解压缩 libncurses5-dev (从 .../libncurses5-dev_5.9-4_amd64.deb) ...正在设置 libtinfo-dev (5.9-4) ...正在设置 libncurses5-dev (5.9-4) ...

链接出错,重头配置再编译ok

/home/luogw/dev-tool/cscope-15.8a/src/input.c:208: undefined reference to `stdscr'/home/luogw/dev-tool/cscope-15.8a/src/input.c:208: undefined reference to `waddch'/home/luogw/dev-tool/cscope-15.8a/src/input.c:179: undefined reference to `stdscr'/home/luogw/dev-tool/cscope-15.8a/src/input.c:179: undefined reference to `waddnstr'/home/luogw/dev-tool/cscope-15.8a/src/input.c:190: undefined reference to `stdscr'/home/luogw/dev-tool/cscope-15.8a/src/input.c:190: undefined reference to `waddch'/home/luogw/dev-tool/cscope-15.8a/src/input.c:193: undefined reference to `stdscr'/home/luogw/dev-tool/cscope-15.8a/src/input.c:193: undefined reference to `waddch'/home/luogw/dev-tool/cscope-15.8a/src/input.c:196: undefined reference to `stdscr'/home/luogw/dev-tool/cscope-15.8a/src/input.c:196: undefined reference to `waddch'/home/luogw/dev-tool/cscope-15.8a/src/input.c:210: undefined reference to `stdscr'/home/luogw/dev-tool/cscope-15.8a/src/input.c:210: undefined reference to `winsch'/home/luogw/dev-tool/cscope-15.8a/src/input.c:211: undefined reference to `stdscr'/home/luogw/dev-tool/cscope-15.8a/src/input.c:211: undefined reference to `waddch'input.o: In function `askforchar':/home/luogw/dev-tool/cscope-15.8a/src/input.c:247: undefined reference to `stdscr'/home/luogw/dev-tool/cscope-15.8a/src/input.c:247: undefined reference to `waddnstr'input.o: In function `askforreturn':/home/luogw/dev-tool/cscope-15.8a/src/input.c:260: undefined reference to `curscr'/home/luogw/dev-tool/cscope-15.8a/src/input.c:260: undefined reference to `wredrawln'collect2: ld 返回 1make[2]: *** [cscope] 错误 1make[2]:正在离开目录 `/home/luogw/dev-tool/cscope-15.8a/src'make[1]: *** [all-recursive] 错误 1make[1]:正在离开目录 `/home/luogw/dev-tool/cscope-15.8a'make: *** [all] 错误 2luogw@luogw-ThinkPad-Edge:~/dev-tool/cscope-15.8a$ ./configure checking for a BSD-compatible install... /usr/bin/install -cchecking whether build environment is sane... yeschecking for a thread-safe mkdir -p... /bin/mkdir -pchecking for gawk... nochecking for mawk... mawkchecking whether make sets $(MAKE)... yeschecking build system type... x86_64-unknown-linux-gnuchecking host system type... x86_64-unknown-linux-gnuchecking for gcc... gccchecking whether the C compiler works... yeschecking for C compiler default output file name... a.outchecking for suffix of executables... checking whether we are cross compiling... nochecking for suffix of object files... ochecking whether we are using the GNU C compiler... yeschecking whether gcc accepts -g... yeschecking for gcc option to accept ISO C89... none neededchecking for style of include used by make... GNUchecking dependency style of gcc... gcc3checking whether gcc and cc understand -c and -o together... yeschecking for flex... nochecking for lex... nochecking for bison... nochecking for byacc... nochecking how to run the C preprocessor... gcc -Echecking for grep that handles long lines and -e... /bin/grepchecking for egrep... /bin/grep -Econfigure: checking "location of ncurses.h file"...Found ncurses on /usr/include/ncurses.hchecking for ncurses version... 5.9checking for ANSI C header files... yeschecking for sys/types.h... yeschecking for sys/stat.h... yeschecking for stdlib.h... yeschecking for string.h... yeschecking for memory.h... yeschecking for strings.h... yeschecking for inttypes.h... yeschecking for stdint.h... yeschecking for unistd.h... yeschecking regex.h usability... yeschecking regex.h presence... yeschecking for regex.h... yeschecking for regcomp in -lregex... nochecking for gnome-config... nochecking for pkg-config... truechecking for dirent.h that defines DIR... yeschecking for library containing opendir... none requiredchecking for ANSI C header files... (cached) yeschecking fcntl.h usability... yeschecking fcntl.h presence... yeschecking for fcntl.h... yeschecking sys/window.h usability... nochecking sys/window.h presence... nochecking for sys/window.h... nochecking sys/termios.h usability... yeschecking sys/termios.h presence... yeschecking for sys/termios.h... yeschecking for unistd.h... (cached) yeschecking signal.h usability... yeschecking signal.h presence... yeschecking for signal.h... yeschecking floss.h usability... nochecking floss.h presence... nochecking for floss.h... nochecking io.h usability... nochecking io.h presence... nochecking for io.h... nochecking for an ANSI C-conforming const... yeschecking for mode_t... yeschecking for pid_t... yeschecking for size_t... yeschecking for sighandler_t... nochecking for sigsetjmp... yeschecking return type of signal handlers... voidchecking for strchr... yeschecking for memcpy... yeschecking for memset... yeschecking for setmode... nochecking for _setmode... nochecking for getcwd... yeschecking for regcmp... nochecking for regcomp... yeschecking for strerror... yeschecking for lstat... yeschecking for fixkeypad... nochecking for getopt_long... yeschecking for stdarg.h... yeschecking for varargs.h... nochecking for vsnprintf... yeschecking whether vsnprintf is C99 compliant... yeschecking for snprintf... yeschecking whether snprintf is C99 compliant... yeschecking for vsnprintf... (cached) yeschecking whether vsnprintf is C99 compliant... (cached) yeschecking for vasprintf... yeschecking for asprintf... yeschecking for vasprintf... (cached) yesconfigure: creating ./config.statusconfig.status: creating Makefileconfig.status: creating doc/Makefileconfig.status: creating src/Makefileconfig.status: creating contrib/Makefileconfig.status: creating config.hconfig.status: executing depfiles commandsluogw@luogw-ThinkPad-Edge:~/dev-tool/cscope-15.8a$ makemake  all-recursivemake[1]: 正在进入目录 `/home/luogw/dev-tool/cscope-15.8a'Making all in docmake[2]: 正在进入目录 `/home/luogw/dev-tool/cscope-15.8a/doc'make[2]: 没有什么可以做的为 `all'。make[2]:正在离开目录 `/home/luogw/dev-tool/cscope-15.8a/doc'Making all in srcmake[2]: 正在进入目录 `/home/luogw/dev-tool/cscope-15.8a/src'gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT fscanner.o -MD -MP -MF .deps/fscanner.Tpo -c -o fscanner.o fscanner.cmv -f .deps/fscanner.Tpo .deps/fscanner.Pogcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT egrep.o -MD -MP -MF .deps/egrep.Tpo -c -o egrep.o egrep.cmv -f .deps/egrep.Tpo .deps/egrep.Pogcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT alloc.o -MD -MP -MF .deps/alloc.Tpo -c -o alloc.o alloc.cmv -f .deps/alloc.Tpo .deps/alloc.Pogcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT basename.o -MD -MP -MF .deps/basename.Tpo -c -o basename.o basename.cmv -f .deps/basename.Tpo .deps/basename.Pogcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT build.o -MD -MP -MF .deps/build.Tpo -c -o build.o build.cbuild.c: 在函数‘build’中:build.c:261:13: 警告: 忽略声明有 warn_unused_result 属性的‘fscanf’的返回值 [-Wunused-result]mv -f .deps/build.Tpo .deps/build.Pogcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT command.o -MD -MP -MF .deps/command.Tpo -c -o command.o command.cmv -f .deps/command.Tpo .deps/command.Pogcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT compath.o -MD -MP -MF .deps/compath.Tpo -c -o compath.o compath.cmv -f .deps/compath.Tpo .deps/compath.Pogcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT crossref.o -MD -MP -MF .deps/crossref.Tpo -c -o crossref.o crossref.cmv -f .deps/crossref.Tpo .deps/crossref.Pogcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT dir.o -MD -MP -MF .deps/dir.Tpo -c -o dir.o dir.cmv -f .deps/dir.Tpo .deps/dir.Pogcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT display.o -MD -MP -MF .deps/display.Tpo -c -o display.o display.cmv -f .deps/display.Tpo .deps/display.Pogcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT edit.o -MD -MP -MF .deps/edit.Tpo -c -o edit.o edit.cmv -f .deps/edit.Tpo .deps/edit.Pogcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT exec.o -MD -MP -MF .deps/exec.Tpo -c -o exec.o exec.cmv -f .deps/exec.Tpo .deps/exec.Pogcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT find.o -MD -MP -MF .deps/find.Tpo -c -o find.o find.cmv -f .deps/find.Tpo .deps/find.Pogcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT help.o -MD -MP -MF .deps/help.Tpo -c -o help.o help.cmv -f .deps/help.Tpo .deps/help.Pogcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT history.o -MD -MP -MF .deps/history.Tpo -c -o history.o history.cmv -f .deps/history.Tpo .deps/history.Pogcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT input.o -MD -MP -MF .deps/input.Tpo -c -o input.o input.cmv -f .deps/input.Tpo .deps/input.Pogcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT invlib.o -MD -MP -MF .deps/invlib.Tpo -c -o invlib.o invlib.cinvlib.c: 在函数‘boolfile’中:invlib.c:978:7: 警告: 忽略声明有 warn_unused_result 属性的‘fread’的返回值 [-Wunused-result]invlib.c:993:10: 警告: 忽略声明有 warn_unused_result 属性的‘fread’的返回值 [-Wunused-result]invlib.c:1002:10: 警告: 忽略声明有 warn_unused_result 属性的‘fread’的返回值 [-Wunused-result]invlib.c:1008:10: 警告: 忽略声明有 warn_unused_result 属性的‘fread’的返回值 [-Wunused-result]invlib.c:1022:10: 警告: 忽略声明有 warn_unused_result 属性的‘fread’的返回值 [-Wunused-result]invlib.c: 在函数‘invfind’中:invlib.c:781:8: 警告: 忽略声明有 warn_unused_result 属性的‘fread’的返回值 [-Wunused-result]invlib.c: 在函数‘invstep’中:invlib.c:704:7: 警告: 忽略声明有 warn_unused_result 属性的‘fread’的返回值 [-Wunused-result]invlib.c: 在函数‘invopen’中:invlib.c:638:8: 警告: 忽略声明有 warn_unused_result 属性的‘fread’的返回值 [-Wunused-result]mv -f .deps/invlib.Tpo .deps/invlib.Pogcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT logdir.o -MD -MP -MF .deps/logdir.Tpo -c -o logdir.o logdir.cmv -f .deps/logdir.Tpo .deps/logdir.Pogcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT lookup.o -MD -MP -MF .deps/lookup.Tpo -c -o lookup.o lookup.cmv -f .deps/lookup.Tpo .deps/lookup.Pogcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.cmain.c: 在函数‘main’中:main.c:618:13: 警告: 忽略声明有 warn_unused_result 属性的‘fscanf’的返回值 [-Wunused-result]main.c:676:9: 警告: 忽略声明有 warn_unused_result 属性的‘fgets’的返回值 [-Wunused-result]mv -f .deps/main.Tpo .deps/main.Pogcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT mouse.o -MD -MP -MF .deps/mouse.Tpo -c -o mouse.o mouse.cmv -f .deps/mouse.Tpo .deps/mouse.Pogcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT mypopen.o -MD -MP -MF .deps/mypopen.Tpo -c -o mypopen.o mypopen.cmv -f .deps/mypopen.Tpo .deps/mypopen.Pogcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT vpaccess.o -MD -MP -MF .deps/vpaccess.Tpo -c -o vpaccess.o vpaccess.cmv -f .deps/vpaccess.Tpo .deps/vpaccess.Pogcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT vpfopen.o -MD -MP -MF .deps/vpfopen.Tpo -c -o vpfopen.o vpfopen.cmv -f .deps/vpfopen.Tpo .deps/vpfopen.Pogcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT vpinit.o -MD -MP -MF .deps/vpinit.Tpo -c -o vpinit.o vpinit.cmv -f .deps/vpinit.Tpo .deps/vpinit.Pogcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT vpopen.o -MD -MP -MF .deps/vpopen.Tpo -c -o vpopen.o vpopen.cmv -f .deps/vpopen.Tpo .deps/vpopen.Pogcc  -g -O2   -o cscope fscanner.o egrep.o alloc.o basename.o build.o command.o compath.o crossref.o dir.o display.o edit.o exec.o find.o help.o history.o input.o invlib.o logdir.o lookup.o main.o mouse.o mygetenv.o mypopen.o vpaccess.o vpfopen.o vpinit.o vpopen.o -lncurses   make[2]:正在离开目录 `/home/luogw/dev-tool/cscope-15.8a/src'Making all in contribmake[2]: 正在进入目录 `/home/luogw/dev-tool/cscope-15.8a/contrib'make[2]: 没有什么可以做的为 `all'。make[2]:正在离开目录 `/home/luogw/dev-tool/cscope-15.8a/contrib'make[2]: 正在进入目录 `/home/luogw/dev-tool/cscope-15.8a'make[2]:正在离开目录 `/home/luogw/dev-tool/cscope-15.8a'make[1]:正在离开目录 `/home/luogw/dev-tool/cscope-15.8a'



原创粉丝点击