On Tue, 17 May 2005 11:08:44 +0800, "Gvs" <tr****@westnet.com.au>
wrote in comp.lang.c:
Hi,
I'm trying to compile an example semaphore .c file taken straight from the
internet, but it won't compile with the error;
gcc seminit.c -o seminit
seminit.c: In function `main':
seminit.c:16: error: storage size of 'arg' isn't known
Does anyone know how to correct this error.??
for reference the code is located at
http://www.ecst.csuchico.edu/~beej/guide/ipc/seminit.c
Any help would be much appreciated.
Kind Regards,
Matt
There is no definition of the type 'enum semun', so it is an
incomplete type and you cannot define objects of an incomplete type.
This is not a standard C type, so presumably it is defined in one of
the three non-standard headers (the ones beginning with "sys/"), at
least on the implementation of the person who wrote the code.
That platform and implementation might or might be the same as yours,
and it might or might not have this type defined in one of those
headers. In any case, you need to take this to a group that supports
your compiler/operating system combination, because it is an extension
and not a type defined by the C language.
--
Jack Klein
Home:
http://JK-Technology.Com
FAQs for
comp.lang.c
http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++
http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html