Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Jun 2007 12:18:21 +0200
From:      "Frank Behrens" <frank@pinky.sax.de>
To:        freebsd-threads@freebsd.org
Subject:   [SOLVED] Re: Linking to pthread library: undefined reference
Message-ID:  <200706171018.l5HAIMTt077127@pinky.frank-behrens.de>
In-Reply-To: <200706151701.l5FH1KuJ047078@pinky.frank-behrens.de>

next in thread | previous in thread | raw e-mail | index | archive | help
Frank Behrens <frank@pinky.sax.de> wrote on 15 Jun 2007 19:01:
>....
> In my Makefile I have:
> CFLAGS+=	-I/usr/local/include -std=c99 -pthread -v
> LDADD+=		-L/usr/local/lib -lmilter
>...
> /usr/lib/libmilter.so: undefined reference to `pthread_detach'

Please excuse for the noise, the problem has been solved. To avoid that others fall into the 
trap here is the reason:

Long, long time ago I tested an application, that needed an pthread-semaphore library. This 
library installed a file named "/usr/local/lib/libpthread.so.20". You know what then happened.

The lesson I learned: 
If you have trouble with the linker use always "ld -Vt" to see whats going on really.

Regards,
   Frank




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200706171018.l5HAIMTt077127>