- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
<分区>
我正在尝试使用 ncurses 库 v 5.9 编译以下代码。在 Debian 上喘息。但是我得到了对库函数的 undefined reference 。我从源代码安装了库。
#include <curses.h>
#include <menu.h>
#include<stdlib.h>
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
#define CTRLD 4
char *choices[] = {
"Choice 1",
"Choice 2",
"Choice 3",
"Choice 4",
"Exit",
};
int main()
{ ITEM **my_items;
int c;
MENU *my_menu;
int n_choices, i;
ITEM *cur_item;
initscr();
cbreak();
noecho();
keypad(stdscr, TRUE);
n_choices = ARRAY_SIZE(choices);
my_items = (ITEM **)calloc(n_choices + 1, sizeof(ITEM *));
for(i = 0; i < n_choices; ++i)
my_items[i] = new_item(choices[i], choices[i]);
my_items[n_choices] = (ITEM *)NULL;
my_menu = new_menu((ITEM **)my_items);
mvprintw(LINES - 2, 0, "F1 to Exit");
post_menu(my_menu);
refresh();
while((c = getch()) != KEY_F(1))
{ switch(c)
{ case KEY_DOWN:
menu_driver(my_menu, REQ_DOWN_ITEM);
break;
case KEY_UP:
menu_driver(my_menu, REQ_UP_ITEM);
break;
}
}
free_item(my_items[0]);
free_item(my_items[1]);
free_menu(my_menu);
endwin();
}
这里是错误
root@sss:/home/sss/Desktop# gcc -Wall -o mn mn.c -lncurses -lmenu
mn.c: In function ‘main’:
mn.c:21:8: warning: unused variable ‘cur_item’ [-Wunused-variable]
mn.c:58:1: warning: control reaches end of non-void function [-Wreturn-type]
/usr/lib/gcc/i486-linux-gnu/4.7/../../../../lib/libmenu.a(m_driver.o): In function `menu_driver':
m_driver.c:(.text+0x33b): undefined reference to `getmouse'
m_driver.c:(.text+0x36c): undefined reference to `wenclose'
m_driver.c:(.text+0x3b0): undefined reference to `wmouse_trafo'
m_driver.c:(.text+0x7b9): undefined reference to `wenclose'
m_driver.c:(.text+0x7f2): undefined reference to `wmouse_trafo'
/usr/lib/gcc/i486-linux-gnu/4.7/../../../../lib/libmenu.a(m_global.o): In function `_nc_Show_Menu':
m_global.c:(.text+0x78b): undefined reference to `copywin'
/usr/lib/gcc/i486-linux-gnu/4.7/../../../../lib/libmenu.a(m_post.o): In function `_nc_Post_Item':
m_post.c:(.text+0x3c): undefined reference to `wattr_on'
m_post.c:(.text+0x8e): undefined reference to `wattr_off'
m_post.c:(.text+0xce): undefined reference to `wattr_on'
m_post.c:(.text+0x276): undefined reference to `wattr_on'
m_post.c:(.text+0x3a3): undefined reference to `wattr_off'
m_post.c:(.text+0x3db): undefined reference to `wattr_off'
m_post.c:(.text+0x424): undefined reference to `wattr_on'
m_post.c:(.text+0x458): undefined reference to `wattr_on'
m_post.c:(.text+0x47e): undefined reference to `wattr_on'
m_post.c:(.text+0x4ce): undefined reference to `wattr_on'
m_post.c:(.text+0x4fe): undefined reference to `wattr_off'
m_post.c:(.text+0x51e): undefined reference to `wattr_off'
m_post.c:(.text+0x53a): undefined reference to `wattr_off'
m_post.c:(.text+0x5b6): undefined reference to `wattr_off'
/usr/lib/gcc/i486-linux-gnu/4.7/../../../../lib/libmenu.a(m_post.o): In function `_nc_Draw_Menu':
m_post.c:(.text+0x605): undefined reference to `wbkgdset'
m_post.c:(.text+0x61f): undefined reference to `wbkgdset'
m_post.c:(.text+0x69e): undefined reference to `wattr_on'
m_post.c:(.text+0x774): undefined reference to `wattr_off'
/usr/lib/gcc/i486-linux-gnu/4.7/../../../../lib/libmenu.a(m_post.o): In function `unpost_menu':
m_post.c:(.text+0xa41): undefined reference to `delwin'
m_post.c:(.text+0xa53): undefined reference to `delwin'
collect2: error: ld returned 1 exit status
我只是有一个更琐碎的问题。 为什么undefined == undefined 返回true,而undefined >= undefined 为false? undefined 等于 undefine
用PHP 7.2编写套接字服务器。根据Firefox 60中的“网络”选项卡,服务器的一些HTTP响应的第一行随机变为undefined undefined undefined。因此,我尝试记录套接字
在 JavaScript 中这是真的: undefined == undefined 但这是错误的: undefined <= undefined 起初我以为<=运算符包含第一个,但我猜它试图将其转换
在回答这个问题 (Difference between [Object, Object] and Array(2)) 时,我在 JavaScript 数组中遇到了一些我以前不知道的东西(具有讽刺意味的
来自https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/of , Note: thi
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
当我添加 到我的 PrimeFaces Mobile 页面,然后我在服务器日志中收到以下警告 WARNING: JSF1064: Unable to find or serve resource, u
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我是一名优秀的程序员,十分优秀!