--- Igor Robul [EMAIL PROTECTED] wrote:
Rob wrote:
--- Igor Robul [EMAIL PROTECTED] wrote:
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
--- Igor Robul [EMAIL PROTECTED] wrote:
Rob wrote:
The dlsym() function returns a null pointer if the
symbol cannot be
found, and sets an error condition
which may be queried with dlerror().
This is a matter of symantic and logic.
I /can/ read this as follows:
If the
--- Igor Robul [EMAIL PROTECTED] wrote:
%mkdir
%cd /
%cat ~/.grace/gracerc.user
USE pow TYPE f_of_dd FROM /usr/lib/libm.so
%ls
%xmgrace
%
OK, great.
Meanwhile, I came closer to the real problem.
You don't need to create the link in /usr/X11R6/lib.
The problem is dlerror().
--- Igor Robul [EMAIL PROTECTED] wrote:
Rob wrote:
When I patch grace with this dummy dlerror(),
prior to the dl-function calls, all works like
a charm (and you don't need the link in
/usr/X11R6/lib anymore).
As I said before, I now have to find out why
grace activates the dlerror()
Rob wrote:
---
XtAppContext app_con;
Display *disp = NULL;
char *display_name = NULL;
XtSetLanguageProc(NULL, NULL, NULL);
XtToolkitInitialize();
app_con = XtCreateApplicationContext();
disp = XOpenDisplay(display_name);
Igor Robul wrote:
dlopen() _does not_ reset dlerror() state on sucess, it just returns
non NULL. So you must not check dlerror() for error condition, you
need check return result of dlopen(), and if it is NULL, then you need
use dlerror().
So, code in grace:
dlopen(library name, MODE);
Sorry,
I have reread manual page for dlerror() and found that it need clear
error state after call, but
dlerror() in src/libc/gen/dlfcn.c does not do this:
#pragma weak dlerror
const char *
dlerror(void)
{
return sorry;
}
So error is in FreeBSD libc, if I understand this correctly. I'll do
Igor Robul wrote:
Sorry,
I have reread manual page for dlerror() and found that it need clear
error state after call, but
dlerror() in src/libc/gen/dlfcn.c does not do this:
#pragma weak dlerror
const char *
dlerror(void)
{
return sorry;
}
So error is in FreeBSD libc, if I understand
--- Igor Robul [EMAIL PROTECTED] wrote:
Rob wrote:
---
XtAppContext app_con;
Display *disp = NULL;
char *display_name = NULL;
XtSetLanguageProc(NULL, NULL, NULL);
XtToolkitInitialize();
app_con = XtCreateApplicationContext();