Centos7 对“tgetflag”的未定义引用

Centos7 对“tgetflag”的未定义引用,centos7,dynamic-linking,sungridengine,Centos7,Dynamic Linking,Sungridengine,在这里,我正在编译Sun Grid引擎源代码,同时执行最后一步。/aimk-no java-no jni-no secure-spool classic-no dump-no qmon,出现如下错误 gcc -o tcsh -DSGE_ARCH_STRING=\"linux-x64\" -O3 -Wall -Wstrict-prototypes -DUSE_POLL -DLINUX -DLINUX_NATIVE -DLINUXX64 -DLINUXX64 -D_GNU_

在这里,我正在编译Sun Grid引擎源代码,同时执行最后一步。/aimk-no java-no jni-no secure-spool classic-no dump-no qmon,出现如下错误

    gcc -o tcsh          -DSGE_ARCH_STRING=\"linux-x64\" -O3 -Wall -Wstrict-prototypes -DUSE_POLL -DLINUX -DLINUX_NATIVE -DLINUXX64 -DLINUXX64 -D_GNU_SOURCE -DGETHOSTBYNAME_R6 -DGETHOSTBYADDR_R8 -DHAS_VSNPRINTF  -DHAS_IN_PORT_T -I/build/berkeleydb/include/ -DTARGET_64BIT  -DSPOOLING_classic  -DNO_JNI -DCOMPILE_DC -D__SGE_COMPILE_WITH_GETTEXT__  -D__SGE_NO_USERMAPPING__ -DTHREADBINDING -DHWLOC -Wno-error -DPROG_NAME='"qtcsh"' -DLINUXX64      -I. -I.. sh.o sh.dir.o sh.dol.o sh.err.o sh.exec.o sh.char.o sh.exp.o sh.func.o sh.glob.o sh.hist.o sh.init.o sh.lex.o sh.misc.o sh.parse.o sh.print.o sh.proc.o sh.sem.o sh.set.o sh.time.o glob.o mi.termios.o ma.setp.o vms.termcap.o tw.help.o tw.init.o tw.parse.o tw.spell.o tw.comp.o tw.color.o ed.chared.o ed.refresh.o ed.screen.o ed.init.o ed.inputl.o ed.defns.o ed.xmap.o ed.term.o tc.alloc.o tc.bind.o tc.const.o tc.defs.o tc.disc.o tc.func.o tc.os.o tc.printf.o tc.prompt.o tc.sched.o tc.sig.o tc.str.o tc.vers.o tc.who.o  -lcrypt                  -L../../../LINUXX64 -L/build/berkeleydb/lib/ -L. -Wl,-rpath,\$ORIGIN/../../lib/linux-x64  -lsge -lpthread    -ldl
ed.screen.o: In function `EchoTC':
ed.screen.c:(.text+0x119a): undefined reference to `tgetflag'
ed.screen.c:(.text+0x137e): undefined reference to `tgoto'
ed.screen.c:(.text+0x138e): undefined reference to `tputs'
ed.screen.c:(.text+0x13c5): undefined reference to `tgetstr'
ed.screen.c:(.text+0x14ab): undefined reference to `tgoto'
ed.screen.c:(.text+0x14bd): undefined reference to `tputs'
ed.screen.c:(.text+0x151e): undefined reference to `tputs'
ed.screen.o: In function `SetAttributes':
ed.screen.c:(.text+0x1ab4): undefined reference to `tputs'
ed.screen.c:(.text+0x1b9c): undefined reference to `tputs'
ed.screen.c:(.text+0x1bd4): undefined reference to `tputs'
ed.screen.o:ed.screen.c:(.text+0x1c35): more undefined references to `tputs' follow
ed.screen.o: In function `MoveToChar':
我已经在谷歌上搜索了tgetflag函数,就是这个。所以我想我可能丢失了ncurses库,在安装了ncurses相关包并重新编译了这样的源代码之后,仍然发生了这样的错误,这真的很奇怪,这是我的ncurses包列表:

    [root@localhost source]# rpm -qa | grep "ncurses*"
ncurses-devel-5.9-14.20130511.el7_4.x86_64
ncurses-libs-5.9-14.20130511.el7_4.x86_64
ncurses-5.9-14.20130511.el7_4.x86_64
ncurses-base-5.9-14.20130511.el7_4.noarch
在安装ncurses相关包并重新编译该源代码后,仍然发生该错误

您的链接行缺少-lncurses,因此链接仍然失败并不奇怪-安装库对于解决您的问题是必要的,但还不够


您必须以某种方式将-lncurse添加到链接行。我不知道确切的步骤;我猜您可能需要重新配置tcsh来实现这一点。

希望这个答案能让人大吃一惊,以下是我的步骤:

删除该项目并提取原始tar.gz文件 确认已下载并安装与ncurses相关的库 导出LD_LIBRARY_PATH=/usr/lib64/:/usr/lib/:/usr/local/lib,此步骤告诉gcc直接获取所需的正确包 ./aimk-no java-no jni-no secure-spool classic-no dump-only depend /脚本/零依赖 ./aimk-no java-no jni-no secure-spool classic-no dump依赖
恩,ncurses动态库是线索,最后我删除了这样的项目并完全重新编译。不管怎样,一切都好了。谢谢你的回复