
line #102 ... allocaBytes (#const sizeof(struct mq_attr)) $ \ p_attrs -> do definition of struct mq_attr on Linux ... struct mq_attr { long int mq_flags; /* Message queue flags. */ long int mq_maxmsg; /* Maximum number of messages. */ long int mq_msgsize; /* Maximum message size. */ long int mq_curmsgs; /* Number of messages currently queued. */ long int __pad[4]; }; build errors received .... vigalchin@ubuntu:~/FTP/Haskell/unix-2.2.0.0$ runhaskell Setup.hs build Preprocessing library unix-2.2.0.0... MQueue.hsc: In function 'main': MQueue.hsc:102:0: error: invalid application of 'sizeof' to incomplete type 'struct mq_attr' MQueue.hsc:102:0: error: invalid application of 'sizeof' to incomplete type 'struct mq_attr' MQueue.hsc:102:0: error: invalid application of 'sizeof' to incomplete type 'struct mq_attr' compiling dist/build/System/Posix/MQueue_hsc_make.c failed comma ??? Kind regards, vasili

On 2008-03-24, Galchin Vasili
vigalchin@ubuntu:~/FTP/Haskell/unix-2.2.0.0$ runhaskell Setup.hs build Preprocessing library unix-2.2.0.0... MQueue.hsc: In function 'main':
MQueue.hsc:102:0: error: invalid application of 'sizeof' to incomplete type 'struct mq_attr'
MQueue.hsc:102:0: error: invalid application of 'sizeof' to incomplete type 'struct mq_attr'
MQueue.hsc:102:0: error: invalid application of 'sizeof' to incomplete type 'struct mq_attr' compiling dist/build/System/Posix/MQueue_hsc_make.c failed comma
This looks as if only a "struct mq_attr;" definition is found, which lets opaque types be defined in C -- only pointers to it may be allocated by the compiler, not the actual struct, nor can sizeof be taken. Does your system have both /usr/include/mqueue.h and /usr/include/bits/mqueue.h -- Aaron Denney -><-

unsubscript Powered by MessageSoft SMG SPAM, virus-free and secure email

Galchin Vasili wrote:
line #102 ...
allocaBytes (#const sizeof(struct mq_attr)) $ \ p_attrs -> do
definition of struct mq_attr on Linux ...
struct mq_attr { long int mq_flags; /* Message queue flags. */ long int mq_maxmsg; /* Maximum number of messages. */ long int mq_msgsize; /* Maximum message size. */ long int mq_curmsgs; /* Number of messages currently queued. */ long int __pad[4]; };
Did you #include the header file that defines this struct? Claude -- http://claudiusmaximus.goto10.org
participants (4)
-
Aaron Denney
-
Claude Heiland-Allen
-
Galchin Vasili
-
王清军