Languages and Scripting

How can I resolve "cid_t" and "msg_perm'" error

 
SOLVED
Go to solution
xinm
Advisor

How can I resolve "cid_t" and "msg_perm'" error

Hi:
When I compile a pro*c program,It happens errors:
...........
/usr/include/sys/ipc.h:51: error: parse error before "cid_t"
/usr/include/sys/ipc.h:56: error: parse error before '}' token
...........
/usr/include/sys/msg.h:93: error: field `msg_perm' has incomplete type

MY Program s Environment:
machine : ia64 hp server rx4640
OS info:
sysname = HP-UX
release = B.11.23
>gcc -v
Reading specs from /usr/local/lib/gcc/ia64-hp-hpux11.23/3.4.2/specs
Configured with: /scratch/njs/pkgbuild/3.3.1/hpux-11/gcc-3.4.2/configure --enable-languages=c,c++ --enable-threads=posix --with-gnu-as --without-gnu-ld --with-as=/usr/local/bin/as --prefix=/usr/local
Thread model: posix
gcc version 3.4.2

I hope somebody can help me.
Thanks!
9 REPLIES 9
Dennis Handly
Acclaimed Contributor

Re: How can I resolve "cid_t" and "msg_perm'" error

Is this a pro*c error or a gcc error?

Does your program work with HP's bundled C compiler after you remove your SQL stuff?
Does it work with gcc?

Can you created a .i file with -E? (Then look at line 51 in ipc.h.)
Steven Schweda
Honored Contributor
Solution

Re: How can I resolve "cid_t" and "msg_perm'" error

Have you upgraded the OS since GCC was
installed? In some cases, this can cause
problems with the header files. (New header
files for the OS, but old ones for GCC.)
Re-installing GCC should fix the problem (if
that is the problem).
Dennis Handly
Acclaimed Contributor

Re: How can I resolve "cid_t" and "msg_perm'" error

>Steven: Have you upgraded the OS since GCC was
installed?

Rats I thought those errors looked familiar. I was going to search but forgot. Here some threads that show the same errors:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1124801
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1135635
Steven Schweda
Honored Contributor

Re: How can I resolve "cid_t" and "msg_perm'" error

> [...] Here some threads [...]

Actual research? Whoa. I just assume that
any complaints about any header files are
caused by the one thing which bit me once.

If nothing else, rebuilding GCC takes so much
time that you can look into many other
possibilities while it's working on that job.
(As a general rule, wherever I find a GCC
binary kit, I don't trust it any further than
using it to build GCC from a source kit.
Call me skeptical. Then the only problem is
remembering to do it all again after anything
happens to change the system header files.)
xinm
Advisor

Re: How can I resolve "cid_t" and "msg_perm'" error

to Dennis Handly:
It makes with gcc,complete error info is:
gcc -g -I. -I/oracle/app/oracle/product/9.2.0/precomp/public -c aa.c
In file included from /usr/include/sys/msg.h:44,
from stdhead.h:29,
from pubfunc.h:20,
from aa.h:27,
from aa.pc:21:
/usr/include/sys/ipc.h:51: error: parse error before "cid_t"
/usr/include/sys/ipc.h:56: error: parse error before '}' token
In file included from stdhead.h:29,
from pubfunc.h:20,
from aa.h:27,
from aa.pc:21:
/usr/include/sys/msg.h:93: error: field `msg_perm' has incomplete type
aa.pc:596:2: warning: no newline at end of file
*** Error exit code 1

Proc program makes error
xinm
Advisor

Re: How can I resolve "cid_t" and "msg_perm'" error

When I make program with "gcc -E",there is no a ".i" file have been created,it errors in the compiling duration.Then I check the ipc.h file "
# ifdef _INCLUDE_HPUX_SOURCE
cid_t cid; /* Compartment ID */
# else
int __cpad; /* pad for non-hp code */
# endif /* _INCLUDE_HPUX_SOURCE */
char pad[12];/* room for future expansion */
};
# define _IPCPERM_T
",
line 51 is:cid_t cid;
line 56 is:};

Thanks all!
Dennis Handly
Acclaimed Contributor

Re: How can I resolve "cid_t" and "msg_perm'" error

>When I make program with "gcc -E", there is no ".i" file have been created,

You have to capture stdout.

>Then I check the ipc.h file

You have to compare the ipc.h file with the fragment in the preprocessed file.

Did you take a look at the links I gave or what Steven suggested?
xinm
Advisor

Re: How can I resolve "cid_t" and "msg_perm'" error

Thanks ALL!

I make this program with "gcc version 4.0.4",then success!

Thanks All!
xinm
Advisor

Re: How can I resolve "cid_t" and "msg_perm'" error

thanks all!