1849355 Members
6677 Online
104043 Solutions
New Discussion

Re: file pthread.h

 
Alberto Delgado
Occasional Contributor

file pthread.h

Hi,

I work on HP-UX 10.20 and I need to use threads. In order to do that I have installed
the DCE-CoreTools, so pthread.h is available on my system.

The problem is that when I try to compile with cc the following error is shown

----------------------------------------------------------------------------------------------------------------------
(Bundled) cc: "/usr/include/dce/cma.h", line 269: error 1000: Unexpected symbol:
"*".
(Bundled) cc: "/usr/include/dce/cma.h", line 275: error 1000: Unexpected symbol:
"cma_handle_equal".
-----------------------------------------------------------------------------------------------------------------------

How can I solve this problem?

Thanks in advance
5 REPLIES 5
Mike Stroyan
Honored Contributor

Re: file pthread.h

It looks like you just need to use the -Ae flag to tell cc to use ANSI mode with HP extensions.
Mike Stroyan
Honored Contributor

Re: file pthread.h

If you are having problems with missing -Ae, you may also be having other trouble with compiler flags. You should have a look at "Programming With Threads on HP-UX" from http://devresource.hp.com./devresource/Docs/Refs/ProgThreads.pdf to see what requirements are for threaded programming on HP-UX 10.20. Chapter 7 has details on compiler options.
Alberto Delgado
Occasional Contributor

Re: file pthread.h

Hi,

when I use -Ae the compiler shows the following

-------------------------------------------------------------------------------------------------------------------
(Bundled) cc: warning 480: The -A option is available only with the C/ANSI C pro
duct; ignored.
(Bundled) cc: "/usr/include/dce/cma.h", line 269: error 1000: Unexpected symbol:
"*".
(Bundled) cc: "/usr/include/dce/cma.h", line 275: error 1000: Unexpected symbol:
"cma_handle_equal".
(Bundled) cc: error 2017: Cannot recover from earlier errors, terminating.
--------------------------------------------------------------------------------------------------------------------

Then, shoud I buy the ANSI C compiler product from HP?


Lasse Knudsen
Esteemed Contributor

Re: file pthread.h

Simple answer - yes.

Just another hthing. Remember that 10.20 DCE threads are not POSIX compliant (only based on a draft). If you are building a program from scratch you might want to look at 11.00 which has got POSIX compliant threads as default. It is still possible to install (pre-POSIX) threads, but you need some tweaks in order to use them under 11.00. Just some thought if 11.00 is an option for you.
In a world without fences - who needs Gates ?
Kenneth Platz
Esteemed Contributor

Re: file pthread.h

Alberto,

The compiler you are using is the "Bundled" C compiler which ships with the HP-UX system. This compiler is not ANSI compliant, nor does it support many features and options of the full ANSI C compiler (especially the -Ae option). This compiler is not intended for software development; it has been included for the purpose of rebuilding the system kernel.

I would recommend against using this compiler for doing software development; I would instead recommend either purchasing the ANSI C Developers Bundle (B3899BA s700 or B3901BA s800), or using the GNU C compiler which can be downloaded from http://hpux.cae.wisc.edu/hppd/hpux/Gnu/gcc-2.95.2/.

Also you should be aware that the threads at HP-UX 10.20 are POSIX draft 4 compliant -- there are substantial differences between HP-UX 10.20 pthreads and, for example, the pthreads as outlined in O'Reilly's "Pthreads programming" book.
I think, therefore I am... I think!