Troubling compiling with pthread [Archive] - C Board

PDA

View Full Version : Troubling compiling with pthread


Yasir_Malik
09-20-2003, 10:50 PM
I am writing a program that uses threads. Everything compiles fine, but when I run the program, I get the following error:
Shared object "libpthread.so.20" not found

Here's what I have in my makefile:

files = thread thread.core temp output
includes = -I/usr/pkg/include
lib = -L/usr/pkg/lib
library = -lpthread

make:
gcc thread.c $(lib) $(includes) $(library) -o thread
./thread -p 23 -c 3 -n 10 -t 5 -s 6

clean:
@for file in $(files); do \
if [ -f $$file ] ; then\
echo "rm $$file"; \
rm $$file; \
fi; \
done;


I am doing my work on NetBSD 1.6.1. Can someone help me out?

rotis23
09-29-2003, 10:32 AM
do you have libpthread.so.20 on your system (find/locate)?

do your default library paths contain it's directory (/etc/ld.so.conf)?

Yasir_Malik
09-30-2003, 07:08 AM
Yes I have all the threading libraries. I solved the problem by doing setting LD_RUN_PATH to /usr/pkg/lib. Is there another way to do it? Thanks.