From owner-freebsd-questions@FreeBSD.ORG Fri Oct 28 05:54:23 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 45DBB16A41F for ; Fri, 28 Oct 2005 05:54:23 +0000 (GMT) (envelope-from spamrefuse@yahoo.com) Received: from web36214.mail.mud.yahoo.com (web36214.mail.mud.yahoo.com [209.191.68.240]) by mx1.FreeBSD.org (Postfix) with SMTP id DC3E743D46 for ; Fri, 28 Oct 2005 05:54:22 +0000 (GMT) (envelope-from spamrefuse@yahoo.com) Received: (qmail 87745 invoked by uid 60001); 28 Oct 2005 05:54:21 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=WkTO1YGtht+59vOFIOlr2sJiFYIAnc2G0FtDeGG28Xv1YlH5DV6ILjH+u1UCun5ojh3MIt8AuQTU+utth6MSuo78Ml+n4q0CprgYp2k4CbAmB2x7ozd/JoDYOP/vhlSwtHgtecvU7yNduKRuu456LHfa2dESV8yzU09T5nnQ6g0= ; Message-ID: <20051028055421.87740.qmail@web36214.mail.mud.yahoo.com> Received: from [147.46.44.181] by web36214.mail.mud.yahoo.com via HTTP; Thu, 27 Oct 2005 22:54:21 PDT Date: Thu, 27 Oct 2005 22:54:21 -0700 (PDT) From: Rob To: Igor Robul , FreeBSD questions In-Reply-To: <4361B914.1020800@speechpro.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: Subject: Re: math/grace port: "libXcursor.so.1.0" not found ?? [SOLVED] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Oct 2005 05:54:23 -0000 --- Igor Robul wrote: > Rob wrote: > > >----------------------------------- > > XtAppContext app_con; > > Display *disp = NULL; > > char *display_name = NULL; > > > > XtSetLanguageProc(NULL, NULL, NULL); > > XtToolkitInitialize(); > > app_con = XtCreateApplicationContext(); > > > > disp = XOpenDisplay(display_name); > >----------------------------------- > > > >(I have simplified this code snippet a bit, for > >this example; also, grace uses Motif for its GUI). > > > >Before the XOpenDisplay() call, dlerror() does > >not have the error-indicator set, but after > >that call, it has. > > > > > I wrote simple program to test XOpenDisplay + > dlopen: > > #include > #include > #include > > main(int argc, char **argv) > { > Display *d; > void *handle; > void *f; > char *err; > > if ((err=dlerror()) != NULL) { > fprintf(stderr,"dlerror: %s\n", > err); > exit(1); > } > > d = XOpenDisplay(NULL); > if (d == NULL) { > fprintf(stderr, "Error in > XOpenDisplay\n"); > exit(1); > } > > if ((err=dlerror()) != NULL) { > fprintf(stderr, "dlerror: %s\n", err); > exit(1); > } > > XCloseDisplay(d); > > handle = dlopen(argv[1], RTLD_NOW); > if (handle == NULL) { > fprintf(stderr, "dlopen: %s\n", dlerror()); > exit(1); > } > > f = dlsym(handle, argv[2]); > if (f == NULL) { > fprintf(stderr, "dlsym: %s\n", dlerror()); > exit(1); > } > > dlclose(handle); > } > > Compile it with > gcc -o t t.c -I /usr/X11R6/include -L /usr/X11R6/lib > -lX11 > > Then test with: > ./t /usr/lib/libm.so pow > > Then > ./t /usr/lib/libm.so pow33 > dlsym: Undefined symbol "pow33" > > So as you can see on my system all looks good. Try > it on your system. > First: NULL return from dlsym() does not always imply an error. dlsym() can return NULL because it has an empty list, but this does not set the error indicator of dlerror(), because it is not an error. However, if an error occurs, dlsym() has NULL as a return (that's probably most sensible return). Second: I get different output than you, from this part of the program: d = XOpenDisplay(NULL); if (d == NULL) { fprintf(stderr, "Error in XOpenDisplay\n"); exit(1); } if ((err=(char *)dlerror()) != NULL) { fprintf(stderr, "dlerror: %s\n", err); exit(1); } I get here: dlerror: Shared object "nss_dns.so.1" not found, required by "t" So apparently dlerror() is set by XOpenDisplay(). Hmmm....yesterday I updated my world and kernel to most recent 5-Stable, and after that I recompiled all my ports. Still get this problem! This is my /etc/make.conf: ----------------------- CFLAGS= -O -pipe NOPROFILE=true NO_PF=true CUPS_OVERWRITE_BASE=yes NO_LPR=yes WITHOUT_NLS=yes WITHOUT_XFT=yes DOC_LANG=en_US.ISO8859-1 WITH_ASPELL=yes WITH_GTK2=yes WITH_GIMP=yes A4=yes WITH_X11=yes # added by use.perl 2005-10-26 14:20:09 PERL_VER=5.8.7 PERL_VERSION=5.8.7 ----------------------- Does that cause any problems? Rob. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com