当前位置: 技术问答>linux和unix
求教一个编程问题,,,有关popt
来源: 互联网 发布时间:2015-08-01
本文导语: 我的一个程序用到了popt库中到一些函数,函数名是robin.c 我直接用gcc robin.c编译, 可是总会出错,错误信息: [root@localhost useful]# gcc robin.c robin.c: In function `main': robin.c:175: warning: passing arg 3 of `poptGetContext' from...
我的一个程序用到了popt库中到一些函数,函数名是robin.c
我直接用gcc robin.c编译,
可是总会出错,错误信息:
[root@localhost useful]# gcc robin.c
robin.c: In function `main':
robin.c:175: warning: passing arg 3 of `poptGetContext' from incompatible pointer type
/tmp/ccE8R33A.o(.text+0x621): In function `main':
: undefined reference to `poptGetContext'
/tmp/ccE8R33A.o(.text+0x638): In function `main':
: undefined reference to `poptGetNextOpt'
/tmp/ccE8R33A.o(.text+0x6df): In function `main':
: undefined reference to `poptStrerror'
/tmp/ccE8R33A.o(.text+0x6f3): In function `main':
: undefined reference to `poptBadOption'
/tmp/ccE8R33A.o(.text+0x71d): In function `main':
: undefined reference to `poptFreeContext'
collect2: ld returned 1 exit status
我已经用了#include
请问是错在哪?是不是我没有安装popt库,,怎么解决?怎么查看popt库,,它放在哪?
我直接用gcc robin.c编译,
可是总会出错,错误信息:
[root@localhost useful]# gcc robin.c
robin.c: In function `main':
robin.c:175: warning: passing arg 3 of `poptGetContext' from incompatible pointer type
/tmp/ccE8R33A.o(.text+0x621): In function `main':
: undefined reference to `poptGetContext'
/tmp/ccE8R33A.o(.text+0x638): In function `main':
: undefined reference to `poptGetNextOpt'
/tmp/ccE8R33A.o(.text+0x6df): In function `main':
: undefined reference to `poptStrerror'
/tmp/ccE8R33A.o(.text+0x6f3): In function `main':
: undefined reference to `poptBadOption'
/tmp/ccE8R33A.o(.text+0x71d): In function `main':
: undefined reference to `poptFreeContext'
collect2: ld returned 1 exit status
我已经用了#include
请问是错在哪?是不是我没有安装popt库,,怎么解决?怎么查看popt库,,它放在哪?
|
gcc -o robin robin.c /usr/lib/libpopt.a