无法编译包括NCURSES.H的代码 [英] unable to compile code including NCURSES.H

查看:125
本文介绍了无法编译包括NCURSES.H的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

团队,
我在使用ncurses.h库编译小代码时遇到问题,以下是编译过程中的错误消息.

gcc test.c -incurses

Hi Team,
I have a problem compiling small code using ncurses.h library and below is the error message during the compilation.

gcc test.c -lncurses

/tmp/cc7AaJ8n.o: In function `main':
test.c:(.text+0xc0): undefined reference to `new_item'
test.c:(.text+0xdd): undefined reference to `new_menu'
test.c:(.text+0x131): undefined reference to `set_menu_win'
test.c:(.text+0x16d): undefined reference to `set_menu_sub'
test.c:(.text+0x189): undefined reference to `set_menu_format'
test.c:(.text+0x19d): undefined reference to `set_menu_mark'
test.c:(.text+0x2d3): undefined reference to `post_menu'
test.c:(.text+0x3aa): undefined reference to `menu_driver'
test.c:(.text+0x3c0): undefined reference to `menu_driver'
test.c:(.text+0x3d6): undefined reference to `menu_driver'
test.c:(.text+0x3ec): undefined reference to `menu_driver'
test.c:(.text+0x422): undefined reference to `unpost_menu'
test.c:(.text+0x42e): undefined reference to `free_menu'
test.c:(.text+0x44d): undefined reference to `free_item'
collect2: ld returned 1 exit status

Additional info:

uname -a:
Linux localhost.localdomain 2.6.33.3-85.fc13.i686 #1 SMP Thu May 6 18:44:12 UTC 2010 i686 i686 i386 GNU/Linux

OS: Fedora

Please guide me in resolving this issue.

Regards,
Kiran

推荐答案

您正在ncurses菜单库中使用与主要ncurses库分开的函数.将-lmenu添加到您的编译器命令行.请参阅: http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/menus.html# COMPILEMENUS [ ^ ]
You are using functions in the ncurses menu library which is separate from the main ncurses library. Add -lmenu to your compiler command line. See: http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/menus.html#COMPILEMENUS[^]


这篇关于无法编译包括NCURSES.H的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆