From owner-freebsd-stable Fri Dec 20 21:41:12 2002 Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DE18537B401 for ; Fri, 20 Dec 2002 21:41:09 -0800 (PST) Received: from smtp-relay.omnis.com (smtp-relay.omnis.com [216.239.128.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id EF81243EDE for ; Fri, 20 Dec 2002 21:41:08 -0800 (PST) (envelope-from wes@softweyr.com) Received: from softweyr.com (dslpool2-019.networldnoc.net [209.63.227.179]) by smtp-relay.omnis.com (Postfix) with ESMTP id DDE81438DB; Fri, 20 Dec 2002 21:38:15 -0800 (PST) Date: Fri, 20 Dec 2002 22:38:26 +0000 From: Wes Peters To: Emiel Kollof Cc: freebsd-stable@FreeBSD.ORG Subject: Re: More information (was Re: pthread woes) Message-Id: <20021220223826.6c728bc6.wes@softweyr.com> In-Reply-To: <20021220020545.GC75547@hackerheaven.org> References: <20021220013445.GA75547@hackerheaven.org> <20021220020545.GC75547@hackerheaven.org> Organization: Softweyr LLC X-Mailer: Sylpheed version 0.8.6 (GTK+ 1.2.10; i386-portbld-freebsd4.7) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, 20 Dec 2002 03:05:45 +0100 Emiel Kollof wrote: > * Emiel Kollof (coolvibe@hackerheaven.org) wrote: > > Hi folks, > > > > I have a problem with compiling stuff that uses POSIX threads. I used > > the following snippet of code to test: > > I tried another snippet of code: > > #include > #include > int main() { > return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ; > return 0; > } > > This fails like this: Nope, you're still making the same mistake: #include #include int main() { printf("%d.%d.%d\n", (gtk_major_version), (gtk_minor_version), (gtk_micro_version)); return 0; } $ gcc -pthread -o gtktest gtktest.c `gtk12-config --libs` `gtk12-config --cflags` $ ./gtktest 1.2.10 By the way: $ gtk12-config --cflags -I/usr/X11R6/include/gtk12 -I/usr/local/include/glib12 -I/usr/local/include -I/usr/X11R6/include If GTK applications on FreeBSD require -pthread to link successfully, gtk12-config should probably include this option when asked for --cflags. > % gcc -o gtktest gtktest.c `gtk12-config --libs` `gtk12-config --cflags` > /usr/X11R6/lib/libX11.so: undefined reference to `pthread_cond_signal' > /usr/X11R6/lib/libXThrStub.so.6: undefined reference to `_Xthr_zero_stub_' > /usr/X11R6/lib/libX11.so: undefined reference to `pthread_cond_broadcast' > /usr/X11R6/lib/libXThrStub.so.6: undefined reference to `_Xthr_self_stub_' > /usr/X11R6/lib/libX11.so: undefined reference to `pthread_cond_init' > /usr/X11R6/lib/libX11.so: undefined reference to `pthread_mutex_unlock' > /usr/X11R6/lib/libX11.so: undefined reference to `pthread_self' > /usr/X11R6/lib/libX11.so: undefined reference to `pthread_mutex_destroy' > /usr/X11R6/lib/libX11.so: undefined reference to `pthread_mutex_lock' > /usr/X11R6/lib/libX11.so: undefined reference to `pthread_cond_wait' > /usr/X11R6/lib/libX11.so: undefined reference to `pthread_cond_destroy' > /usr/X11R6/lib/libX11.so: undefined reference to `pthread_mutex_init' > > Now I suspect X11 libraries doing something weird. I am recompiling my > X11R6 libs from source to see if this solves things. All of the references to missing pthread functions should've caught your attention. -- Where am I, and what am I doing in this handbasket? Wes Peters wes@softweyr.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message