Operating System - HP-UX
1833016 Members
2161 Online
110048 Solutions
New Discussion

Compiling a program on 64 bits HW/OS

 
SOLVED
Go to solution
Sathya Sastry
Frequent Advisor

Compiling a program on 64 bits HW/OS

I am trying to compile and link a program on 64 bit system so that I can use higher memory requirement.
The maxdsiz_64 is set higher than 4GB, but when I compile and run a sample program, the program exits after allocating 1.8GB memory.

I am not using any specific flags except the following.
-Aa -DD64 -N

According to Compiler document, for a 64 bit process, it should be able to use larger than 4GB vertual address space.

Any tips and corrections to compile/link flags?

Thanks,
Regards,
Sathya.
3 REPLIES 3
ranganath ramachandra
Esteemed Contributor
Solution

Re: Compiling a program on 64 bits HW/OS

im not sure if that was a typo you made only in posting here - the correct compiler flag is +DD64, not -DD64. no special linker flags are required (or exist), the linker will know whether its a 32- or 64- bit link from the object files.
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo

Tim Adamson_1
Honored Contributor

Re: Compiling a program on 64 bits HW/OS

Hi Sathya,

The -DD64 should be +DD64.

Check the cc man page.


Cheers!
Yesterday is history, tomorrow is a mystery, today is a gift. That's why it's called the present.
Sathya Sastry
Frequent Advisor

Re: Compiling a program on 64 bits HW/OS

Thanks, that solved my issue.