error: implicit declaration of function ‘popen’; did you mean ‘fopen’? [-Werror=implicit-function-declaration]
error: implicit declaration of function ‘pclose’; did you mean ‘fclose’? [-Werror=implicit-function-declaration]
请问下为什么这样会报隐式声明错误呀?
源代码如下:
GList *fList = s_wEntries;
s_wEntries=NULL;
FILE *fstream=NULL;
char buff[1024];
memset(buff,0,sizeof(buff));
// execute command get all video
char *launchword="find / -name *";
strcat(launchword,cText);
strcat(launchword,"*");
if(NULL==(fstream=popen(launchword,"r")))
{
}
else
{
memset(buff, 0x00, sizeof(buff));
FileEntryInfo *Finfo;
GtkMenuItem* searchmenuitem;
while(NULL!=fgets(buff, sizeof(buff), fstream)){
if(buff[0]=='/')
{
searchmenuitem=gtk_menu_item_new_with_label(buff);
Finfo->uri=buff;
Finfo->pMenuItem=searchmenuitem;
g_list_prepend(s_wEntries,Finfo);
}
memset(buff, 0x00, sizeof(buff));
}
pclose(fstream);
}