It is currently Fri, 23 Aug 2019 23:02:01 GMT



 
Author Message
 bad pthreads (or some other error)?
Hi folks,

is there any way to compile the pthreads (aka linuxthreads) seperately from
glibc? It's because when I try to link a programm against phtreads, it
won't work. lipthreads.a and .so are installed, but when I call
libpthreads.so, he will quit with a segfault-error - so I suppose, either
it's a bad compile or there is another problem. Also when trying to compile
something linked dynamically against pthread, I get a whole lotta errors
like as if the linker didn't even see the libs:

/usr/include/pthread.h:141: `pthread_t' was not declared in this scope
/usr/include/pthread.h:141: `__thread' was not declared in this scope
/usr/include/pthread.h:142: parse error before `*'

and so on... actually, it's not my program, but I don't wanna hack the code
and it worked before already, but when I tried to udgrade to glibc-2.2,
some things just didn't work anymore, so I removed it again, but I'm not
sure if I really got everything cleaned.

They are all installed in the usual dirs, like /lib /usr/lib and
/usr/local/lib so I think no problem really here. I looked through
gnu-archives but couldn't find anything like linuxthreads there and on the
web I only found the old 0.7 version, but I need 0.8 at least.

Any help and hints would be greatly appreciated, thanks in advance,

Bert Buchholz



 Mon, 13 Oct 2003 04:59:13 GMT   
 bad pthreads (or some other error)?
: Hi folks,
<snip>
: ... Also when trying to compile
: something linked dynamically against pthread, I get a whole lotta errors
: like as if the linker didn't even see the libs:

: /usr/include/pthread.h:141: `pthread_t' was not declared in this scope
: /usr/include/pthread.h:141: `__thread' was not declared in this scope
: /usr/include/pthread.h:142: parse error before `*'

These aren't linker errors, these are compiler errors. It's telling you
that it has not seen a declaration of pthread_t. That means there's some
#include directive missing from the code, or a broken include file.

On my RH62 box pthread.h includes bits/pthreadtypes.h which in turn
contains a typedef of pthread_t. It sounds as if something is wrong
with that relationship on your system.

: and so on... actually, it's not my program, but I don't wanna hack the code

You may need to hack it just to fix whatever is busted in it.

: and it worked before already, but when I tried to udgrade to glibc-2.2,
: some things just didn't work anymore, so I removed it again, but I'm not
: sure if I really got everything cleaned.

Again: It's not a library problem, it's either a problem with your system
include files, or a problem with the program.

: Bert Buchholz

--
---- Fred Smith -- fre...@fcshome.stoneham.ma.us ----------------------------
                       I can do all things through Christ
                              who strengthens me.
------------------------------ Philippians 4:13 -------------------------------



 Mon, 13 Oct 2003 18:51:38 GMT   
 bad pthreads (or some other error)?

Thank you for your answer. Well, in fact, that's quite exactly what I
thought, and I'm not really unexperienced with this stuff, I'm doing this
for some time now and recently decided to install glibc-2.2 but after I had
done it, I found some incompatabilities and tried to get it out of my
system again, which worked rather well, but some things like this
linuxthread-thing doesn't work. I checked the source of the progs I tried
to compile - everything seemed okay, paths and so on. I even re-installed
glibc and glibgpp from rpms again, run ldconfig and so forth, but, well,
I'm still getting these errors. I'm sure, it just something small I'm
overseeing, but what? Well I gonna check everything all over again, but if
you have any other ideas, please don't wait telling me. But I really
appreciate your answer, it's just what I thought -- afterwards :)

Okay, thanks again!

- Show quoted text -



 Tue, 14 Oct 2003 04:47:55 GMT   
 bad pthreads (or some other error)?
In your program, be sure to

#include <pthread.h>

and in your gcc command be sure to link against the library

gcc -o program program.c -lpthread

(that's a lower-case 'L' in '-lpthread'.)

That *should* do it.
Stephen.

--
Stephen Hui, ARL:UT, Austin, TX

"Backups are for wimps. Real men upload their data to an
FTP site and have everyone else mirror it." - Linus Torvalds



 Tue, 14 Oct 2003 23:13:29 GMT   
 bad pthreads (or some other error)?

Thanks, I solved the problem yesterday (I was aware of this -lpthread
stuff, but thanks anyway), I made a rather ugly hack (if you can call it a
hack :) ), but non the less it worked. But I'm still not sure, if the rest
of my libc is set up correctly... well, suppose I got to figure out the
next days.

Bert



 Tue, 14 Oct 2003 23:41:50 GMT   
 
   [ 5 post ] 

Similar Threads

1. Bad, bad, bad error...

2. DiskSuite - 1 stripe bad, others okay

3. Understanding bad blocks (ESDI/others)

4. Install error: error 2 reading header: cpio: Bad magic

5. Errors compiling with ftok(), struct timespec, and pthreads

6. pthreads compilation/linking error for glibc /w linuxthreads

7. Missing linux/error.h (and others)

8. Questions: CRC Error, Segmentation Fault, some others...

9. Strange error with pthreads


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software