Date: 21 Dec 2002 00:59:07 -0500 From: Joe Marcus Clarke <marcus@marcuscom.com> To: Wes Peters <wes@softweyr.com> Cc: Emiel Kollof <coolvibe@hackerheaven.org>, freebsd-stable@FreeBSD.ORG Subject: Re: More information (was Re: pthread woes) Message-ID: <1040450347.29101.56.camel@shumai.marcuscom.com> In-Reply-To: <20021220223826.6c728bc6.wes@softweyr.com> References: <20021220013445.GA75547@hackerheaven.org> <20021220020545.GC75547@hackerheaven.org> <20021220223826.6c728bc6.wes@softweyr.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
On Fri, 2002-12-20 at 17:38, Wes Peters wrote:
> On Fri, 20 Dec 2002 03:05:45 +0100 Emiel Kollof <coolvibe@hackerheaven.org> 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 <gtk/gtk.h>
> > #include <stdio.h>
> > 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 <gtk/gtk.h>
> #include <stdio.h>
> 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.
Actually, it would come through with --libs. However, this isn't
necessary for all gtk12 applications. For instance, this test app
compiles just fine without -pthread. Threaded gtk applications usually
make use of the gthread module, which, if you run glib12-config gthread
--libs, does give you -thread. I suspect something is badly screwed up
with Emiel's X11 installation.
Joe
--
PGP Key : http://www.marcuscom.com/pgp.asc
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)
iD8DBQA+BAMqb2iPiv4Uz4cRAg/MAJwMjqqfkYPrOxVXT3ae8JSwmKmE/QCfRY4w
oP1GwlfMFPcNCRBwhFEfScI=
=QdA8
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1040450347.29101.56.camel>
