1827481 Members
2010 Online
109965 Solutions
New Discussion

HP-UX C++ Compiler error

 
zlogdan
Occasional Visitor

HP-UX C++ Compiler error

Hi

I am primarly a C++ programmer and I mostly - 95% - do my work on AIX, however, my boss requested us to have a HP-UX server that could be used for compilation. My company has hired a third party company to install HPUX and we had asked them to install an usable C++ compiler.

When I try to compile a very simple C++ program like

#include <iostream>
using namespace std;
int main()
{
cout << "Hello World " << endl;
return 0;
}

I get the error:

# aCC -AA test.cpp
Error 8: "/usr/include/machine/sys/_types.h", line 65 # Invalid type specifier combination in declaration: "short double".
__fpreg __for_alignment_only_do_not_use;
^^^^^^^

As you can see I am a complete ignorant on HPUX but I need to validate that this third party company effectively installed a workable C++ compiler. Below information on the environment.

# uname -a
HP-UX FISSPHP3 B.11.23 U ia64 1476851688 unlimited-user license
# aCC -V
aCC: HP ANSI C++ B3910B A.03.30
#

From the above outputs I suppose that the compiler and runtime are installed but is this the compiler version I would need?

I found out another oddity : most information on the internet ask me to use swlist but this server does not have swlist.

# which swlist
no swlist in /usr/bin /opt/ansic/bin /usr/ccs/bin /usr/contrib/bin /usr/contrib/Q4/bin /opt/ipf/bin /opt/hparray/bin /opt/nettladm/bin /opt/fcms/bin /opt/sas/bin /usr/bin/X11 /opt/resmon/bin /usr/contrib/kwdb/bin /opt/wbem/bin /opt/wbem/sbin /opt/graphics/common/bin /opt/sfm/bin /opt/upgrade/bin /opt/sec_mgmt/bastille/bin /opt/dsau/bin /opt/dsau/sbin /opt/firefox /opt/gnome/bin /opt/ignite/bin /opt/mozilla /opt/perl/bin /opt/sec_mgmt/spc/bin /opt/ssh/bin /opt/hpsmh/bin /opt/thunderbird /opt/gwlm/bin /usr/contrib/bin/X11 /opt/aCC/bin /opt/langtools/bin /opt/aCC/binsoftware .

 

5 REPLIES 5
Steven Schweda
Honored Contributor

Re: HP-UX C++ Compiler error

> [...] My company has hired a third party company to install HPUX and
> we had asked them to install an usable C++ compiler.

   Did you specifically ask for old versions of the OS and compiler?
Did you pay for "current" or for "whatever"?  Did you get a software
support contract as part of that bundle?

> # uname -a
> HP-UX FISSPHP3 B.11.23 U ia64 1476851688 unlimited-user license

   11.31 is newer than 11.23.  (And has been around for years.)

> # aCC -V
> aCC: HP ANSI C++ B3910B A.03.30

   Also not the current version, I believe:

https://h20392.www2.hpe.com/portal/swdepot/displayProductInfo.do?productNumber=B9007AAEVAL

[...]
      This bundle installs either of the following product versions:

          HP C/aC++ version A.06.26 on HP Integrity servers.   <---
          HP aC++ version A.03.95 on PA-RISC-based systems.
[...]

   And that Web page is dated "June 2011", so it may be old, too.
(The "ia64" in your "uname -a" report says "Integrity".)

   I know approximately nothing about aCC (which would cost me actual
money, so I use GCC), but I can imagine that there are patches for these
products, which are available to those with support contracts.  There
may be a patch for your problem.  (I lack paid-support, so I can't
tell.)

> I get the error:
> [...]

   I, too, would be a little disappointed by any fatal problems in the
system header files.

> I found out another oddity : most information on the internet ask me to
> use swlist but this server does not have swlist.

   Around here:

rux# uname -a
HP-UX rux B.11.31 U ia64 1678555272 unlimited-user license

rux# type swlist
swlist is /usr/sbin/swlist

   I don't see "/usr/sbin" on your PATH, which does not speak well of
whoever set up this thing.

> # aCC -AA test.cpp

   I know nothing, but is ".cpp" a good filetype to use here?  The
examples in the manual I found suggest ".C".

http://h20565.www2.hpe.com/hpsc/doc/public/display?sp4ts.oid=4268164&docLocale=en_US&docId=emr_na-c02652146

[...]
      C++ Source File (.C file)
          You must name the HP aC++ source files with extensions
          beginning with either .c or .C, possibly followed by
          additional characters.  If you compile only, for example by
          using -c, each C++ source file produces an object file with
          the same file name prefix as the source file and a .o file
          name suffix.
[...]

zlogdan
Occasional Visitor

Re: HP-UX C++ Compiler error

Hi Steven, thanks a lot for the answer.

>>Did you specifically ask for old versions of the OS and compiler?
>>Did you pay for "current" or for "whatever"?  Did you get a software
>>support contract as part of that bundle?

We specifically asked for an old OS version, our end customer has it. I am not aware how my company has made the deal to acquire the compiler but we needed one that works. We have support from a third party company but due to limited budget the task to make this compiler work was assigned to me.

Thanks, I have added /usr/sbin to my PATH var on my .profile it is working now.

We have to use aCC, because from what I read it is how we call the HPUX C++ compiler and our product is written in C++.

regards

Daniel

Steven Schweda
Honored Contributor

Re: HP-UX C++ Compiler error

> We specifically asked for an old OS version, our end customer has it.

   Ok.  What about the compiler?  Any reason not to use a current
version of that?

> [...] My company has hired a third party company to install HPUX and
> we had asked them to install an usable C++ compiler.

   Not having any aCC around here (and especially not that old version),
I can't prove much, but I'd say that you didn't get a "usable C++
compiler".  Using the (old) GCC which I have on my 11.31 system:

rux$ g++ -o cxx1 cxx1.cpp
rux$ ./cxx1
Hello World

rux$ g++ -v
Using built-in specs.
Target: ia64-hp-hpux11.31
Configured with: ../gcc-4.3.3/configure
Thread model: posix
gcc version 4.3.3 (GCC)

   No problem on a local VMS system, either:

alp $ cxx cxx1.cpp
alp $ cxxlink cxx1
alp $ run cxx1
Hello World

alp $ cxx /version
HP C++ V7.3-009 for OpenVMS Alpha V8.4    

   So, the consensus seems to be that your C++ program is, in fact, a
C++ program.  (And, I'd say that a C++ compiler which can't handle it is
not a C++ compiler.)

> We have to use aCC, because from what I read it is how we call the
> HPUX C++ compiler and our product is written in C++.

   Well, yeah, that's the command for the HP[E] HP-UX C++ compiler, but
that's not the only HP-UX C++ compiler in the world.

   Not that I think that it should be necessary, but have you tried
omitting the "-AA" option?

   Not knowing the details of your agreements, requirements, and
constraints (and with my lack of access to any aCC), my advice may be
worth little, but I'd complain to your "a third party company" about
that compiler/installation.

   If you wish to explore a free alternative, GCC, then a visit to the
"HP-UX Porting and Archive Centre", which offers a GCC depot (older than
I'd've thought) suitable for HP-UX 11.23, might be interesting:

      http://hpux.connect.org.uk/hppd/hpux/Gnu/gcc-4.2.3/

   I gather from my Web search, that HP[E] also offers (newer) GCC kits
to "AllianceOne Partner Program" members.  If you're selling software
for HP-UX, then you might get more than GCC from that program.  (Actual
"Software downloads, development tools, add-ons, service packs, product
updates, and beta/preview releases", for example.)

      http://h21007.www2.hpe.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801?ciid=2a08725cc2f02110725cc2f02110275d6e10RCRD

Dennis Handly
Acclaimed Contributor

Re: HP-UX C++ compiler error

> Error 8: "/usr/include/machine/sys/_types.h", line 65 # Invalid type specifier combination in declaration: "short double".
> __fpreg __for_alignment_only_do_not_use;\HP-UX FISSPHP3 B.11.23 U ia64 1476851688 unlimited-user license
> aCC: HP ANSI C++ B3910B A.03.30

 

This is the PA-RISC compiler.  It can't run correctly on Integrity without a PA-RISC SDK.


> this server does not have swlist.

 

If you don't have the system set up correctly, use absolute paths.  swlist(1m) is a management tool.

 

>I don't see "/usr/sbin" on your PATH, which does not speak well of whoever set up this thing.

 

This is correct.  Normal users don't have this in their PATH.  Only sysadmins or root typically need it.

> I know nothing, but is ".cpp" a good filetype to use here?

 

This is perfectly fine.  It said: possibly followed by additional characters.  

 

>I'd say that you didn't get a "usable C++ compiler".

 

Did the OP want a PA-RISC compiler or an Integrity one?

 

>but have you tried omitting the "-AA" option?

 

That won't help.  And required for that old PA-RISC compiler.

Steven Schweda
Honored Contributor

Re: HP-UX C++ compiler error

> >I don't see "/usr/sbin" on your PATH, which does not speak well of
> whoever set up this thing.
>
> This is correct.  Normal users don't have this in their PATH.  Only
> sysadmins or root typically need it.

   Which "this" is correct?  "/usr/sbin" not being expected on PATH, or
its absence being lame?  Knowing nothing, I took the "# " prompt as
suggestive of the user being "root", on whose PATH I'd expect to find
"/usr/sbin".


> > I know nothing, but is ".cpp" a good filetype to use here?
>
> This is perfectly fine.  It said: possibly followed by additional
> characters.  

   I decided that later, but "possibly followed by additional
characters" struck me as more than slightly vague.  GCC docs provide an
actual list (which includes ".cpp", I discovered later).