Unix Technical Forum

xlC version 8 file inclusion errors when using -I option

This is a discussion on xlC version 8 file inclusion errors when using -I option within the AIX Operating System forums, part of the Unix Operating Systems category; --> Hi, We've upgraded from the Visual Age version 6 compiler to XLC/C++ 8. The compiler works ok when all ...


Go Back   Unix Technical Forum > Unix Operating Systems > AIX Operating System

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-05-2008, 11:32 AM
MK
 
Posts: n/a
Default xlC version 8 file inclusion errors when using -I option

Hi,

We've upgraded from the Visual Age version 6 compiler to XLC/C++ 8.
The compiler works ok when all source is in the same directory and the
-I option is not specified. Once using the -I option I get errors such
as those below regardless of whether using the C (xlc) or C++ (xlC)
compiler. We didn't encounter such errors with VA 6, so any help is
much appreciated.

>make

xlc -c decNumber.c -I../include
"/usr/include/sys/inttypes.h", line 59.9: 1506-046 (S) Syntax error.
"/usr/include/sys/inttypes.h", line 64.8: 1506-166 (S) Definition of
function intmax_t requires parentheses.
"/usr/include/sys/inttypes.h", line 64.17: 1506-276 (S) Syntax error:
possible missing '{'?
"/usr/include/sys/inttypes.h", line 68.30: 1506-045 (S) Undeclared
identifier __nptr.
"/usr/include/sys/inttypes.h", line 68.38: 1506-045 (S) Undeclared
identifier __endptr.
"/usr/include/sys/inttypes.h", line 68.48: 1506-045 (S) Undeclared
identifier __base.
"/usr/include/sys/inttypes.h", line 89.8: 1506-166 (S) Definition of
function intmax_t requires parentheses.
"/usr/include/sys/inttypes.h", line 89.17: 1506-276 (S) Syntax error:
possible missing '{'?
"/usr/include/sys/types.h", line 330.3: 1506-273 (E) Missing type in
declaration of sigset_t.
"/usr/include/sys/types.h", line 342.9: 1506-046 (S) Syntax error.
"/usr/include/sys/types.h", line 377.9: 1506-046 (S) Syntax error.
"/usr/include/sys/vm_types.h", line 36.9: 1506-166 (S) Definition of
function ulong_t requires parentheses.
"/usr/include/sys/vm_types.h", line 36.25: 1506-276 (S) Syntax error:
possible missing '{'?
"/usr/include/sys/vm_types.h", line 142.9: 1506-045 (S) Undeclared
identifier vmhandle_t.
"/usr/include/sys/vm_types.h", line 143.9: 1506-045 (S) Undeclared
identifier caddr_t.
"/usr/include/sys/vm_types.h", line 148.3: 1506-273 (E) Missing type
in declaration of vmaddr_t.
"/usr/include/sys/vm_types.h", line 158.9: 1506-046 (S) Syntax error.
"/usr/include/sys/vm_types.h", line 250.9: 1506-166 (S) Definition of
function vmhandle_t requires parentheses.
"/usr/include/sys/vm_types.h", line 250.25: 1506-276 (S) Syntax error:
possible missing '{'?
"/usr/include/sys/m_types.h", line 52.27: 1506-275 (S) Unexpected text
iar encountered.
"/usr/include/sys/m_types.h", line 52.9: 1506-045 (S) Undeclared
identifier ulong_t.
"/usr/include/sys/m_types.h", line 53.27: 1506-275 (S) Unexpected text
stack encountered.
"/usr/include/sys/m_types.h", line 54.27: 1506-275 (S) Unexpected text
toc encountered.
"/usr/include/sys/m_types.h", line 55.27: 1506-275 (S) Unexpected text
cr encountered.
"/usr/include/sys/m_types.h", line 56.27: 1506-275 (S) Unexpected text
intpri encountered.
"/usr/include/sys/m_types.h", line 57.27: 1506-277 (S) Syntax error:
possible missing ';' or ','?
"/usr/include/sys/m_types.h", line 67.3: 1506-273 (E) Missing type in
declaration of label_t.
"/usr/include/sys/m_types.h", line 69.9: 1506-166 (S) Definition of
function int32long64_t requires parentheses.
"/usr/include/sys/m_types.h", line 69.25: 1506-276 (S) Syntax error:
possible missing '{'?
"/usr/include/sys/types.h", line 538.30: 1506-273 (E) Missing type in
declaration of physadr_t.
"/usr/include/sys/types.h", line 539.9: 1506-166 (S) Definition of
function physadr_t requires parentheses.
"/usr/include/sys/types.h", line 539.25: 1506-276 (S) Syntax error:
possible missing '{'?
make: 1254-004 The error code from the last command is 1.


Stop.

The compiler config file looks ok to me. Here are the settings for the
C and C++ compiler for reference:

* -qlanglvl=extc89 C compiler with common extensions, UNIX headers
xlc: use = DEFLT
crt = /lib/crt0.o
mcrt = /lib/mcrt0.o
gcrt = /lib/gcrt0.o
libraries = -L/usr/vac/lib,-lxlopt,-lc
proflibs = -L/lib/profiled,-L/usr/lib/profiled
options = -qlanglvl=extc89,-qcpluscmt,-qkeyword=inline,-
qalias=ansi


* C++ compiler
xlc++: use = DEFLT
crt = /lib/crt0.o
mcrt = /lib/mcrt0.o
gcrt = /lib/gcrt0.o
xlC = /usr/vacpp/bin/xlC
libraries2 = -L/usr/vac/lib,-lxlopt,-L/usr/vacpp/lib,-lC,-lm,-
lc
proflibs = -L/usr/vacpp/lib/profiled,-L/lib/profiled,-L/usr/
lib/profiled
hdlibs = -L/usr/vac/lib,-lhC,-lhmd
options = -qalias=ansi

* C++ compiler
xlC: use = DEFLT
crt = /lib/crt0.o
mcrt = /lib/mcrt0.o
gcrt = /lib/gcrt0.o
xlC = /usr/vacpp/bin/xlC
libraries2 = -L/usr/vac/lib,-lxlopt,-L/usr/vacpp/lib,-lC,-lm,-
lc
proflibs = -L/usr/vacpp/lib/profiled,-L/lib/profiled,-L/usr/
lib/profiled
hdlibs = -L/usr/vac/lib,-lhC,-lhmd
options = -qalias=ansi


Regards,

Michael

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-05-2008, 11:32 AM
Derek E. Lewis
 
Posts: n/a
Default Re: xlC version 8 file inclusion errors when using -I option

On Tue, 3 Apr 2007, MK wrote:

> Hi,
>
> We've upgraded from the Visual Age version 6 compiler to XLC/C++ 8.
> The compiler works ok when all source is in the same directory and the
> -I option is not specified. Once using the -I option I get errors such
> as those below regardless of whether using the C (xlc) or C++ (xlC)
> compiler. We didn't encounter such errors with VA 6, so any help is
> much appreciated.


This may be a long shot, but I suspect VAC is expecting C99-compliant
includes, and depending on the version of AIX you're using, you may not
have C99-compliant includes. I've seen this a lot between AIX and Solaris,
especially older releases of each respective operating system. Try kicking
VAC into a non-C99 mode (C89, etc.).

Derek E. Lewis
delewis at acm.org
http://delewis.blogspot.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-05-2008, 11:33 AM
MK
 
Posts: n/a
Default Re: xlC version 8 file inclusion errors when using -I option

On Apr 5, 1:47 am, "Derek E. Lewis" <dele...@acm.org> wrote:
> On Tue, 3 Apr 2007, MK wrote:
> > Hi,

>
> > We've upgraded from the Visual Age version 6 compiler to XLC/C++ 8.
> > The compiler works ok when all source is in the same directory and the
> > -I option is not specified. Once using the -I option I get errors such
> > as those below regardless of whether using the C (xlc) or C++ (xlC)
> > compiler. We didn't encounter such errors with VA 6, so any help is
> > much appreciated.

>
> This may be a long shot, but I suspect VAC is expecting C99-compliant
> includes, and depending on the version of AIX you're using, you may not
> have C99-compliant includes. I've seen this a lot between AIX and Solaris,
> especially older releases of each respective operating system. Try kicking
> VAC into a non-C99 mode (C89, etc.).
>
> Derek E. Lewis
> delewis at acm.orghttp://delewis.blogspot.com


Hi Derek,

Thanks for the reply. I don't think this is the problem though. I
modified the compiler options from

xlc -c decNumber.c -I../include

which causes the above errors, to the following which works fine

xlc -c decNumber.c -I/usr/include -I/usr/vac/include -I../include

Why would the 2nd command work but the 1st not. My understanding is
that the compiler should have a default system include path.

Anyway, this is related to C compilation. Moving on to C++. I tried
adding the include paths for C++ code but still the same problems. I
tried all invocations or aliases of the compiler, those you mentioned
and everything else in the bin directory but still no go. I'm
currently looking at the compiler options, but cannot see anything
that I need to change. As I previously stated, the default compiler
configuration file looks ok, but I may be wrong.

Regards,

Michael

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-05-2008, 11:33 AM
A. Bolmarcich
 
Posts: n/a
Default Re: xlC version 8 file inclusion errors when using -I option

On 2007-04-04, MK <michaelkatsilis@yahoo.com> wrote:
> Hi,
>
> We've upgraded from the Visual Age version 6 compiler to XLC/C++ 8.
> The compiler works ok when all source is in the same directory and the
> -I option is not specified. Once using the -I option I get errors such
> as those below regardless of whether using the C (xlc) or C++ (xlC)
> compiler. We didn't encounter such errors with VA 6, so any help is
> much appreciated.
>
>>make

> xlc -c decNumber.c -I../include
> "/usr/include/sys/inttypes.h", line 59.9: 1506-046 (S) Syntax error.
> "/usr/include/sys/inttypes.h", line 64.8: 1506-166 (S) Definition of
> function intmax_t requires parentheses.


[snip]

A possible cause of this type of problem is that the ../include
directory has a file named stdint.h that does not contain
declarations that /usr/include/sys/inttype.h uses.

If there is a ../include/stdint.h file, temporarily remove it and
compile decNumber.c to see if it uses declarations made in
.../include/stdint.h that are not made in the now standard
/usr/include/stdint.h. At best, the now standard stdint.h
will have all the declarations and you can erase ../include/stdint.h.

At worst, you can rename ../include/stdint.h, modify it to not
duplicate declarations in the standard stdint.h, and and change the
#includes of it to use the new name.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-05-2008, 11:42 AM
MK
 
Posts: n/a
Default Re: xlC version 8 file inclusion errors when using -I option

On Apr 6, 1:14 am, "A. Bolmarcich" <agge...@earl-grey.cloud9.net>
wrote:
> On 2007-04-04, MK <michaelkatsi...@yahoo.com> wrote:
>
> > Hi,

>
> > We've upgraded from the Visual Age version 6 compiler to XLC/C++ 8.
> > The compiler works ok when all source is in the same directory and the
> > -I option is not specified. Once using the -I option I get errors such
> > as those below regardless of whether using the C (xlc) or C++ (xlC)
> > compiler. We didn't encounter such errors with VA 6, so any help is
> > much appreciated.

>
> >>make

> > xlc -c decNumber.c -I../include
> > "/usr/include/sys/inttypes.h", line 59.9: 1506-046 (S) Syntax error.
> > "/usr/include/sys/inttypes.h", line 64.8: 1506-166 (S) Definition of
> > function intmax_t requires parentheses.

>
> [snip]
>
> A possible cause of this type of problem is that the ../include
> directory has a file named stdint.h that does not contain
> declarations that /usr/include/sys/inttype.h uses.
>
> If there is a ../include/stdint.h file, temporarily remove it and
> compile decNumber.c to see if it uses declarations made in
> ../include/stdint.h that are not made in the now standard
> /usr/include/stdint.h. At best, the now standard stdint.h
> will have all the declarations and you can erase ../include/stdint.h.
>
> At worst, you can rename ../include/stdint.h, modify it to not
> duplicate declarations in the standard stdint.h, and and change the
> #includes of it to use the new name.


Excellent, you are correct and this worked.

Thanks & Regards,

Michael

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:49 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com