dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[DotGNU]progress on x11-winforms on os x


From: Ian Fung
Subject: [DotGNU]progress on x11-winforms on os x
Date: Sun, 15 Jun 2003 00:18:59 -0400

rhysw,

hey, i think i did it. but i'm going to need some help from you. here
is my open function (all the way at the end). so the deal is that
libX11.dylib is a dynamic library and not bundle. so right now i
believe it is returning from this function and you are getting the
correct module. the problem now is rather trivial, but i dont know
where to fix it. now when i run it, i get:

address@hidden samples]$ ilrun XHello.exe
NSCreateObjectFileImageFromFile(/usr/X11R6/lib/libX11.dylib, &file)
ERROR: NSObjectFileImageInappropriateFile
XInitThreads: could not find the specified symbol
XOpenDisplay: could not find the specified symbol
Uncaught exception: Xsharp.XCannotConnectException: X/Windows library
is not present, or could not be
located on the library search path.

As you will notice, it says it can't find two symbols, the problem is
that on BSD systems, all symbols are prepended by an underscore. so we
gotta do this at compile time, i was told that there was a macro in
autoconf or something that does that. when i do a nm on libX11.dylib,
all the symbols are indeed preceded by an underscore.

let me know when you have that so i can test it out again.

thanks,

alias

void *ILDynLibraryOpen(const char *name)
{
   NSObjectFileImage file = 0;
   NSObjectFileImageReturnCode result;
   NSModule module = 0;

   printf("NSCreateObjectFileImageFromFile(%s, &file)\n", name);
   /* Attempt to open the dylib file */
   result = NSCreateObjectFileImageFromFile(name, &file);
   switch (result)
   {
     case NSObjectFileImageSuccess :
       printf("NSObjectFileImageSuccess\n");
       /* Link the module dependencies */
       module = NSLinkModule(file, name,
           NSLINKMODULE_OPTION_BINDNOW |
           NSLINKMODULE_OPTION_PRIVATE |
           NSLINKMODULE_OPTION_RETURN_ON_ERROR);

       return (void *)module;
       break;

     case NSObjectFileImageFailure :
       printf("ERROR: NSObjectFileImageFailure\n");
       break;
     case NSObjectFileImageInappropriateFile :
       printf("ERROR: NSObjectFileImageInappropriateFile\n");
       /* Probably is a dynamic library instead of a bundle, try to load
it */
       module = (void *)NSAddImage(name,
NSADDIMAGE_OPTION_RETURN_ON_ERROR);

       return (void *)module;
       break;
     case NSObjectFileImageArch :
       printf("ERROR: NSObjectFileImageArch\n");
       break;
     case NSObjectFileImageFormat :
       printf("ERROR: NSObjectFileImageFormat\n");
       break;
     case NSObjectFileImageAccess :
       printf("ERROR: NSObjectFileImageAccess\n");
       break;
     default :
       printf("Unexpected result from
NSCreateObjectFileImageFromFile\n");
   }

   return 0;
}



reply via email to

[Prev in Thread] Current Thread [Next in Thread]