Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C 如何编译使用getsubopt()的代码?_C_Parsing_Options_Getopt - Fatal编程技术网

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
,但编译器没有获取声明。