Operating System - HP-UX
1754371 Members
3244 Online
108813 Solutions
New Discussion

pthread and compile error

 
Kevin Tan
New Member

pthread and compile error

Platform: Dec Alpha v5.1

Had written an application using POSIX thread. Eventhough I had include the required -pthread flag into the C compiler (cc), the compiler complains the following error.

cc: Error: /usr/include/pthread.h, line 971: Ill-formed parameter type list. (parmtyplist)
typedef void __pthreadExtDestructorFunc_t (void*, pthread_t, pthread_key_t);
-----------------------------------------------------^

cc: Error: /usr/include/pthread.h, line 1277: Error parsing parameter list. Found "*" when expecting one of: ",", ")". (notexpecting)
extern int pthread_mutex_setprioceiling (pthread_mutex_t*, int, int*);
--------------------------------------------------------^


cc: Error: /usr/include/pthread.h, line 1303: Error parsing parameter list. Found "*" when expecting one of: ",", ")". (notexpecting)
extern int pthread_condattr_init (pthread_condattr_t*);
----------------------------------------------------^

(pls ignore the error point --^)

and many other pthread_ type having the similar error message. From the error message, seem that these pthread_ types are not define.

Think the C compiler in DEC v5.1 support threaded program, as the manual mention the -pthread flag.

Had read newsgroups and DCEThread guide, but found nothing useful.

Would appreciate your diagnotics and hint to resolve it. Thanking in advance
1 REPLY 1
Kevin Tan
New Member

Re: pthread and compile error

Besides -pthread option in compiler and linker as describe in newsgroup and DECthread manual i added following to compiler flag to resolve my compilation error,

-D_POSIX_C_SOURCE=199506L

I found useful explanation in /usr/include/pthread.h