kevin1
September 11th, 2005, 01:40 PM
I am trying to use g_lstat to obtain the attributes of a file.
Partial source code:
#include <glib.h>
#include <glib/gstdio.h>
struct stat *filedata;
guint result;
result = g_lstat(filename,filedata);
I am getting a compiler error:
"warning: implicit declaration of function `lstat'"
There are no other error messages.
g_lstat is #defined as lstat in gstdio.h.
gstdio.h #includes <sys/stat.h>, (which defines lstat) so I shouldn't have to include it myself.
As expected, adding it to my source file does not solve the problem, nor does adding all the #includes shown by 'man lstat':
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
I have checked for stat.h on my system - it is under /usr/include/sys/.
What else should I check?
Thanks for any advice,
Kevin ](*,)
Partial source code:
#include <glib.h>
#include <glib/gstdio.h>
struct stat *filedata;
guint result;
result = g_lstat(filename,filedata);
I am getting a compiler error:
"warning: implicit declaration of function `lstat'"
There are no other error messages.
g_lstat is #defined as lstat in gstdio.h.
gstdio.h #includes <sys/stat.h>, (which defines lstat) so I shouldn't have to include it myself.
As expected, adding it to my source file does not solve the problem, nor does adding all the #includes shown by 'man lstat':
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
I have checked for stat.h on my system - it is under /usr/include/sys/.
What else should I check?
Thanks for any advice,
Kevin ](*,)