Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* Compiling with Pthreads
@ 1994-05-25 15:48 Michael D. Tan
  1994-05-25 20:16 ` Simon Patience
  0 siblings, 1 reply; 2+ messages in thread
From: Michael D. Tan @ 1994-05-25 15:48 UTC (permalink / raw)



I have a C program which uses the pthreads package.  I'm trying to
compile it on an Alpha running OSF/1 v1.3.  I have included
<phtread.h>.  When I try to compile I have to say "cc test.c
-lpthreads" in order to succeed.  At this point, I have compiled
without errors, but the executable doesn't work (nothing happens- not
even my printf statements at the beginning of the program).  When I
run under gdb, I get messages such as

(gdb) run
Starting program: /a/jolt/home/glue4/mdtanx/med/test 
13588:/a/jolt/home/glue4/mdtanx/med/test: /sbin/loader: Error: unresolvable symbol in /usr/shlib/libpthreads.so: mach_init
13588:/a/jolt/home/glue4/mdtanx/med/test: /sbin/loader: Error: unresolvable symbol in /usr/shlib/libpthreads.so: task_self_
13588:/a/jolt/home/glue4/mdtanx/med/test: /sbin/loader: Error: unresolvable symbol in /usr/shlib/libpthreads.so: vm_page_size
13588:/a/jolt/home/glue4/mdtanx/med/test: /sbin/loader: Fatal Error: this executable has unresolvable symbols

Program exited with code 01.
You can't do that without a process to debug
(gdb) 


Are there some more libraries to which I need to link?  I found
nothing in hte man pages, and for some reason, we didn't buy any of
the printed documentation.

Michael Tan
mdtanx@cs.umd.edu



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Compiling with Pthreads
  1994-05-25 15:48 Compiling with Pthreads Michael D. Tan
@ 1994-05-25 20:16 ` Simon Patience
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Patience @ 1994-05-25 20:16 UTC (permalink / raw)


In article <MDTANX.94May25114815@poptart.cs.umd.edu>, mdtanx@poptart.cs.umd.edu (Michael D. Tan) writes:
> 
> I have a C program which uses the pthreads package.  I'm trying to
> compile it on an Alpha running OSF/1 v1.3.  I have included
> <phtread.h>.  When I try to compile I have to say "cc test.c
> -lpthreads" in order to succeed. 

You need to say
	cc test.c -lpthread -lmach -lc_r
in that order. I think you can also say
	cc -threads test.c
but I will wait for someone from DEC to say that.

Simon.

-- 
  Simon Patience				Phone: (617) 621-7376
  Open Software Foundation			FAX:   (617) 621-8696
  1 Cambridge Center				Email: sp@osf.org
  Cambridge, MA 02142				       uunet!osf!sp


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1994-05-25 20:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-05-25 15:48 Compiling with Pthreads Michael D. Tan
1994-05-25 20:16 ` Simon Patience

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox