Compiling with Pthreads

Brian Kennison bkenniso at postoffice.worldnet.att.net
Thu Dec 2 15:00:04 EST 1999


I posted this earlier but I didn't get many responses and I would 
like to get this thing going so I'm posting it again. I'm trying to compile
with threads so that I can use Zope.

I'm not a programmer so I'm having trouble understanding the following
compiler errors. (I know that these symbols are coming from pthread.h but
don't know enough about it to even attempt a fix) I'm working with Python
1.5.2,the FSU pthread library on the MachTen platform.


gcc -g -O2 -I./../Include -I.. -DHAVE_CONFIG_H   -c thread.c -o thread.o
In file included from thread.c:150:
thread_pthread.h:113: parse error before `pthread_cond_t'
thread_pthread.h:113: warning: no semicolon at end of struct or union
thread_pthread.h:114: warning: data definition has no type or storage class
thread_pthread.h:115: warning: data definition has no type or storage class
thread_pthread.h: In function `PyThread_start_new_thread':
thread_pthread.h:155: `pthread_t' undeclared (first use this function)
thread_pthread.h:155: (Each undeclared identifier is reported only once
thread_pthread.h:155: for each function it appears in.)
thread_pthread.h:155: parse error before `th'
thread_pthread.h:161: `th' undeclared (first use this function)
thread_pthread.h:175: `pthread_attr_t' undeclared (first use this function)
thread_pthread.h:175: parse error before `)'
thread_pthread.h: In function `PyThread_get_thread_ident':
thread_pthread.h:193: syntax error before `threadid'
thread_pthread.h:197: `threadid' undeclared (first use this function)
thread_pthread.h: In function `PyThread_allocate_lock':
thread_pthread.h:249: `lock' undeclared (first use this function)
thread_pthread.h:250: parse error before `int'
thread_pthread.h:256: parse error before `)'
thread_pthread.h:261: `status' undeclared (first use this function)
thread_pthread.h:262: `pthread_mutexattr_t' undeclared (first use this
function)
thread_pthread.h:262: parse error before `)'
thread_pthread.h:263: `error' undeclared (first use this function)
thread_pthread.h:266: `pthread_condattr_t' undeclared (first use this
function)
thread_pthread.h:266: parse error before `)'
thread_pthread.h: In function `PyThread_free_lock':
thread_pthread.h:281: `thelock' undeclared (first use this function)
thread_pthread.h:281: parse error before `)'
thread_pthread.h: In function `PyThread_acquire_lock':
thread_pthread.h:298: `thelock' undeclared (first use this function)
thread_pthread.h:298: parse error before `)'
thread_pthread.h: In function `PyThread_release_lock':
thread_pthread.h:334: `thelock' undeclared (first use this function)
thread_pthread.h:334: parse error before `)'
thread_pthread.h: At top level:
thread_pthread.h:357: parse error before `pthread_mutex_t'
thread_pthread.h:357: warning: no semicolon at end of struct or union
thread_pthread.h:358: warning: data definition has no type or storage class
thread_pthread.h:360: parse error before `}'
thread_pthread.h: In function `PyThread_allocate_sema':
thread_pthread.h:371: sizeof applied to an incomplete type
thread_pthread.h:373: dereferencing pointer to incomplete type
thread_pthread.h:374: dereferencing pointer to incomplete type
thread_pthread.h:375: `pthread_mutexattr_t' undeclared (first use this
function)
thread_pthread.h:375: parse error before `)'
thread_pthread.h:377: dereferencing pointer to incomplete type
thread_pthread.h:378: `pthread_condattr_t' undeclared (first use this
function)
thread_pthread.h:378: parse error before `)'
thread_pthread.h: In function `PyThread_free_sema':
thread_pthread.h:395: dereferencing pointer to incomplete type
thread_pthread.h:397: dereferencing pointer to incomplete type
thread_pthread.h: In function `PyThread_down_sema':
thread_pthread.h:408: dereferencing pointer to incomplete type
thread_pthread.h:411: dereferencing pointer to incomplete type
thread_pthread.h:412: dereferencing pointer to incomplete type
thread_pthread.h:413: dereferencing pointer to incomplete type
thread_pthread.h:419: dereferencing pointer to incomplete type
thread_pthread.h:420: dereferencing pointer to incomplete type
thread_pthread.h:425: dereferencing pointer to incomplete type
thread_pthread.h: In function `PyThread_up_sema':
thread_pthread.h:437: dereferencing pointer to incomplete type
thread_pthread.h:439: dereferencing pointer to incomplete type
thread_pthread.h:440: dereferencing pointer to incomplete type
thread_pthread.h:442: dereferencing pointer to incomplete type
make[1]: *** [thread.o] Error 1
make[1]: Leaving directory `/usr/local/Src/Python-1.5.2/Python'
make: *** [Python] Error 2


thread_pthread.h looks like this:

   110 typedef struct {
    111         char  locked; /* 0=unlocked, 1=locked */
    112         /* a <cond, mutex> pair to handle an acquire of a locked
lock */
    113         pthread_cond_t   lock_released;
    114         pthread_mutex_t  mut;
    115 }; pthread_lock;


Any help would be appreciated.

Brian Kennison





More information about the Python-list mailing list