f



compilation issues on 64bit HPUX11 with aCC compiler

Hi All,
    I have used following code:
#include <sys/resource.h>
struct rlimit64 r_limit;
 getrlimit64 (RLIMIT_AS, &r_limit);

When I try to compile this with aCC: HP ANSI C++ B3910B A.03.39 compiler
following error message comes:

Error 628:line 2465 # "rlimit64#1524 r_limit" [ line 2465] cannot be defined 
to have an incomplete type.
            struct rlimit64 r_limit;
                            ^^^^^^^
Error 403:  line 2485 # Undeclared variable 'getrlimit64'. Perhaps 
'getrlimit' as in "int getrlimit(int,rlimit *)" 
["/usr/include/sys/resource.h", line 135] was intended.
            getrlimit64 (RLIMIT_AS, &r_limit);
            ^^^^^^^^^^^

Do I need to add some compiler flags for 64bit compilation? 
TIA
Manish
0
Manish
10/3/2003 10:42:27 AM
comp.sys.hp.hpux 4408 articles. 1 followers. dewi.bening (7) is leader. Post Follow

7 Replies
826 Views

Similar Articles

[PageSpeed] 16

"Manish" <manishbaronia@nowhere.com> a �crit dans le message de
news:3f7d5296@news.cadence.com...
> Hi All,
>     I have used following code:
> #include <sys/resource.h>
> struct rlimit64 r_limit;
>  getrlimit64 (RLIMIT_AS, &r_limit);
>
> When I try to compile this with aCC: HP ANSI C++ B3910B A.03.39 compiler
> following error message comes:
>
> Error 628:line 2465 # "rlimit64#1524 r_limit" [ line 2465] cannot be
defined
> to have an incomplete type.
>             struct rlimit64 r_limit;
>                             ^^^^^^^
> Error 403:  line 2485 # Undeclared variable 'getrlimit64'. Perhaps
> 'getrlimit' as in "int getrlimit(int,rlimit *)"
> ["/usr/include/sys/resource.h", line 135] was intended.
>             getrlimit64 (RLIMIT_AS, &r_limit);
>             ^^^^^^^^^^^
>
> Do I need to add some compiler flags for 64bit compilation?
> TIA
> Manish

Hi,

You need to use the "+DA2.0W" flag in order to perform 64bit compilation.

R�my


0
R
10/3/2003 12:17:41 PM
R�my wrote:

> 
> "Manish" <manishbaronia@nowhere.com> a �crit dans le message de
> news:3f7d5296@news.cadence.com...
>> Hi All,
>>     I have used following code:
>> #include <sys/resource.h>
>> struct rlimit64 r_limit;
>>  getrlimit64 (RLIMIT_AS, &r_limit);
>>
>> When I try to compile this with aCC: HP ANSI C++ B3910B A.03.39 compiler
>> following error message comes:
>>
>> Error 628:line 2465 # "rlimit64#1524 r_limit" [ line 2465] cannot be
> defined
>> to have an incomplete type.
>>             struct rlimit64 r_limit;
>>                             ^^^^^^^
>> Error 403:  line 2485 # Undeclared variable 'getrlimit64'. Perhaps
>> 'getrlimit' as in "int getrlimit(int,rlimit *)"
>> ["/usr/include/sys/resource.h", line 135] was intended.
>>             getrlimit64 (RLIMIT_AS, &r_limit);
>>             ^^^^^^^^^^^
>>
>> Do I need to add some compiler flags for 64bit compilation?
>> TIA
>> Manish
> 
> Hi,
> 
> You need to use the "+DA2.0W" flag in order to perform 64bit compilation.
> 
> R�my
Hello R�my,
   Here are the flags I am already using:
-D_PROTOTYPES -DSYSV +DA2.0W -D_REENTRANT +Z -Aa -AA
But I get those errors, yet.
Manish
0
Manish
10/3/2003 1:28:05 PM
"Manish" <manishbaronia@nowhere.com> a �crit dans le message de
news:3f7d7965@news.cadence.com...
> R�my wrote:
>
> >
> > "Manish" <manishbaronia@nowhere.com> a �crit dans le message de
> > news:3f7d5296@news.cadence.com...
> >> Hi All,
> >>     I have used following code:
> >> #include <sys/resource.h>
> >> struct rlimit64 r_limit;
> >>  getrlimit64 (RLIMIT_AS, &r_limit);
> >>
> >> When I try to compile this with aCC: HP ANSI C++ B3910B A.03.39
compiler
> >> following error message comes:
> >>
> >> Error 628:line 2465 # "rlimit64#1524 r_limit" [ line 2465] cannot be
> > defined
> >> to have an incomplete type.
> >>             struct rlimit64 r_limit;
> >>                             ^^^^^^^
> >> Error 403:  line 2485 # Undeclared variable 'getrlimit64'. Perhaps
> >> 'getrlimit' as in "int getrlimit(int,rlimit *)"
> >> ["/usr/include/sys/resource.h", line 135] was intended.
> >>             getrlimit64 (RLIMIT_AS, &r_limit);
> >>             ^^^^^^^^^^^
> >>
> >> Do I need to add some compiler flags for 64bit compilation?
> >> TIA
> >> Manish
> >
> > Hi,
> >
> > You need to use the "+DA2.0W" flag in order to perform 64bit
compilation.
> >
> > R�my
> Hello R�my,
>    Here are the flags I am already using:
> -D_PROTOTYPES -DSYSV +DA2.0W -D_REENTRANT +Z -Aa -AA
> But I get those errors, yet.
> Manish

Sorry, i don't have any HP-UX box here, but you should look in
/usr/include/sys/resource.h and see what #define are needed to obtain the
definition of getrlimit64. There should be some #ifdef in this file.

R�my


0
R
10/3/2003 1:40:32 PM
"R�my" <remy.bertrand@cgeyt.com> wrote:

> "Manish" <manishbaronia@nowhere.com> a �crit dans le message de
> news:3f7d7965@news.cadence.com...
>> R�my wrote:
>>
>> >
>> > "Manish" <manishbaronia@nowhere.com> a �crit dans le message de
>> > news:3f7d5296@news.cadence.com...
>> >> Hi All,
>> >>     I have used following code:
>> >> #include <sys/resource.h>
>> >> struct rlimit64 r_limit;
>> >>  getrlimit64 (RLIMIT_AS, &r_limit);
>> >>
>> >> When I try to compile this with aCC: HP ANSI C++ B3910B A.03.39
> compiler
>> >> following error message comes:
>> >>
>> >> Error 628:line 2465 # "rlimit64#1524 r_limit" [ line 2465] cannot be
>> > defined
>> >> to have an incomplete type.
>> >>             struct rlimit64 r_limit;
>> >>                             ^^^^^^^
>> >> Error 403:  line 2485 # Undeclared variable 'getrlimit64'. Perhaps
>> >> 'getrlimit' as in "int getrlimit(int,rlimit *)"
>> >> ["/usr/include/sys/resource.h", line 135] was intended.
>> >>             getrlimit64 (RLIMIT_AS, &r_limit);
>> >>             ^^^^^^^^^^^
>> >>
>> >> Do I need to add some compiler flags for 64bit compilation?
>> >> TIA
>> >> Manish
>> >
>> > Hi,
>> >
>> > You need to use the "+DA2.0W" flag in order to perform 64bit
> compilation.
>> >
>> > R�my
>> Hello R�my,
>>    Here are the flags I am already using:
>> -D_PROTOTYPES -DSYSV +DA2.0W -D_REENTRANT +Z -Aa -AA
>> But I get those errors, yet.

I don't have an 11.0 box at the moment, but looking at the source
tree you don't get the 64-bit definitions unless you add the
compiler flag _LARGEFILE64_SOURCE (either as a -D_ flag or just
#define if before the inclusion of resource.h in your source..

Don

>> Manish

> Sorry, i don't have any HP-UX box here, but you should look in
> /usr/include/sys/resource.h and see what #define are needed to obtain the
> definition of getrlimit64. There should be some #ifdef in this file.

> R�my



-- 
Quidquid latine dictum sit, altum sonatur.
0
dmorris
10/3/2003 3:29:05 PM
dmorris@cup.hp.com wrote:

> "R�my" <remy.bertrand@cgeyt.com> wrote:
> 
>> "Manish" <manishbaronia@nowhere.com> a �crit dans le message de
>> news:3f7d7965@news.cadence.com...
>>> R�my wrote:
>>>
>>> >
>>> > "Manish" <manishbaronia@nowhere.com> a �crit dans le message de
>>> > news:3f7d5296@news.cadence.com...
>>> >> Hi All,
>>> >>     I have used following code:
>>> >> #include <sys/resource.h>
>>> >> struct rlimit64 r_limit;
>>> >>  getrlimit64 (RLIMIT_AS, &r_limit);
>>> >>
>>> >> When I try to compile this with aCC: HP ANSI C++ B3910B A.03.39
>> compiler
>>> >> following error message comes:
>>> >>
>>> >> Error 628:line 2465 # "rlimit64#1524 r_limit" [ line 2465] cannot be
>>> > defined
>>> >> to have an incomplete type.
>>> >>             struct rlimit64 r_limit;
>>> >>                             ^^^^^^^
>>> >> Error 403:  line 2485 # Undeclared variable 'getrlimit64'. Perhaps
>>> >> 'getrlimit' as in "int getrlimit(int,rlimit *)"
>>> >> ["/usr/include/sys/resource.h", line 135] was intended.
>>> >>             getrlimit64 (RLIMIT_AS, &r_limit);
>>> >>             ^^^^^^^^^^^
>>> >>
>>> >> Do I need to add some compiler flags for 64bit compilation?
>>> >> TIA
>>> >> Manish
>>> >
>>> > Hi,
>>> >
>>> > You need to use the "+DA2.0W" flag in order to perform 64bit
>> compilation.
>>> >
>>> > R�my
>>> Hello R�my,
>>>    Here are the flags I am already using:
>>> -D_PROTOTYPES -DSYSV +DA2.0W -D_REENTRANT +Z -Aa -AA
>>> But I get those errors, yet.
> 
> I don't have an 11.0 box at the moment, but looking at the source
> tree you don't get the 64-bit definitions unless you add the
> compiler flag _LARGEFILE64_SOURCE (either as a -D_ flag or just
> #define if before the inclusion of resource.h in your source..
> 
> Don
> 
>>> Manish
> 
>> Sorry, i don't have any HP-UX box here, but you should look in
>> /usr/include/sys/resource.h and see what #define are needed to obtain the
>> definition of getrlimit64. There should be some #ifdef in this file.
> 
>> R�my
> 
> 
> 
-D_LARGEFILE64_SOURCE removes some errors, but, following errors still 
remain:
Error 406: "processInputsIn.cpp", line 2487 # Argument type 'rlimit64 *' 
does not match expected parameter
    type 'rlimit *'; 'struct rlimit64' is not an unambiguously derived class 
of 'struct rlimit'.
            getrlimit64 (RLIMIT_AS, &r_limit);
                                    ^
Error 406: "processInputsIn.cpp", line 2490 # Argument type 'rlimit64 *' 
does not match expected parameter
    type 'rlimit *'; 'struct rlimit64' is not an unambiguously derived class 
of 'struct rlimit'.
            getrlimit64 (RLIMIT_DATA, &r_limit);

Do I need some more flags?
0
Manish
10/6/2003 5:15:41 AM
Manish wrote:

> dmorris@cup.hp.com wrote:
> 
>> "R�my" <remy.bertrand@cgeyt.com> wrote:
>> 
>>> "Manish" <manishbaronia@nowhere.com> a �crit dans le message de
>>> news:3f7d7965@news.cadence.com...
>>>> R�my wrote:
>>>>
>>>> >
>>>> > "Manish" <manishbaronia@nowhere.com> a �crit dans le message de
>>>> > news:3f7d5296@news.cadence.com...
>>>> >> Hi All,
>>>> >>     I have used following code:
>>>> >> #include <sys/resource.h>
>>>> >> struct rlimit64 r_limit;
>>>> >>  getrlimit64 (RLIMIT_AS, &r_limit);
>>>> >>
>>>> >> When I try to compile this with aCC: HP ANSI C++ B3910B A.03.39
>>> compiler
>>>> >> following error message comes:
>>>> >>
>>>> >> Error 628:line 2465 # "rlimit64#1524 r_limit" [ line 2465] cannot be
>>>> > defined
>>>> >> to have an incomplete type.
>>>> >>             struct rlimit64 r_limit;
>>>> >>                             ^^^^^^^
>>>> >> Error 403:  line 2485 # Undeclared variable 'getrlimit64'. Perhaps
>>>> >> 'getrlimit' as in "int getrlimit(int,rlimit *)"
>>>> >> ["/usr/include/sys/resource.h", line 135] was intended.
>>>> >>             getrlimit64 (RLIMIT_AS, &r_limit);
>>>> >>             ^^^^^^^^^^^
>>>> >>
>>>> >> Do I need to add some compiler flags for 64bit compilation?
>>>> >> TIA
>>>> >> Manish
>>>> >
>>>> > Hi,
>>>> >
>>>> > You need to use the "+DA2.0W" flag in order to perform 64bit
>>> compilation.
>>>> >
>>>> > R�my
>>>> Hello R�my,
>>>>    Here are the flags I am already using:
>>>> -D_PROTOTYPES -DSYSV +DA2.0W -D_REENTRANT +Z -Aa -AA
>>>> But I get those errors, yet.
>> 
>> I don't have an 11.0 box at the moment, but looking at the source
>> tree you don't get the 64-bit definitions unless you add the
>> compiler flag _LARGEFILE64_SOURCE (either as a -D_ flag or just
>> #define if before the inclusion of resource.h in your source..
>> 
>> Don
>> 
>>>> Manish
>> 
>>> Sorry, i don't have any HP-UX box here, but you should look in
>>> /usr/include/sys/resource.h and see what #define are needed to obtain
>>> the definition of getrlimit64. There should be some #ifdef in this file.
>> 
>>> R�my
>> 
>> 
>> 
> -D_LARGEFILE64_SOURCE removes some errors, but, following errors still
> remain:
> Error 406: "processInputsIn.cpp", line 2487 # Argument type 'rlimit64 *'
> does not match expected parameter
>     type 'rlimit *'; 'struct rlimit64' is not an unambiguously derived
>     class
> of 'struct rlimit'.
>             getrlimit64 (RLIMIT_AS, &r_limit);
>                                     ^
> Error 406: "processInputsIn.cpp", line 2490 # Argument type 'rlimit64 *'
> does not match expected parameter
>     type 'rlimit *'; 'struct rlimit64' is not an unambiguously derived
>     class
> of 'struct rlimit'.
>             getrlimit64 (RLIMIT_DATA, &r_limit);
> 
> Do I need some more flags?
And I am not sure why -D_LARGEFILE64_SOURCE  should be used on 64bit, 
because 64 bit already supports >2G file size. Should I be using 
rlimit, getrlimit instead of rlimit64, getrlimit64 on 64bit too?>
Please help me clarify my doubts.
 Thanks,
Manish

0
Manish
10/6/2003 5:52:29 AM
Manish <manishbaronia@nowhere.com> wrote in message news:<3f81031e@news.cadence.com>...

> And I am not sure why -D_LARGEFILE64_SOURCE  should be used on 64bit, 
> because 64 bit already supports >2G file size. Should I be using 
> rlimit, getrlimit instead of rlimit64, getrlimit64 on 64bit too?>

yes, if you are compiling 64-bit, i think you just have to use
getrlimit/rlimit and set _LARGEFILE64_SOURCE while compiling.
0
jignaasu
10/7/2003 4:38:21 AM
Reply: