C 如何编译使用getsubopt()的代码?
我想解析形式为C 如何编译使用getsubopt()的代码?,c,parsing,options,getopt,C,Parsing,Options,Getopt,我想解析形式为key1=val1、key2=val2等的选项列表(与mount-o的选项类似)。getsubopt()函数似乎非常适合此任务()。但是,当我尝试使用gcc编译代码时,我得到: warning: implicit declaration of function ‘getsubopt’ 当我运行程序时,它会出现故障。您有: #define _XOPEN_SOURCE 500 #include <stdlib.h> \define\XOPEN\u源代码500 #包括
key1=val1、key2=val2等的选项列表(与mount-o的选项类似)。getsubopt()
函数似乎非常适合此任务()。但是,当我尝试使用gcc编译代码时,我得到:
warning: implicit declaration of function ‘getsubopt’
当我运行程序时,它会出现故障。您有:
#define _XOPEN_SOURCE 500
#include <stdlib.h>
\define\XOPEN\u源代码500
#包括
在包含对子脚本的调用的文件顶部
?如果调用一个尚未声明的函数,您将得到预期的错误。I#included
,但编译器没有获取声明。