Can't load nppdf.so. How to load lib without dlopen()?

From: ebleble (ebleble_at_poczta.fm)
Date: 05/29/04

  • Next message: Jens.Toerring_at_physik.fu-berlin.de: "Re: Can't load nppdf.so. How to load lib without dlopen()?"
    Date: 29 May 2004 09:53:27 -0700
    
    

    Hi,
    I try to load 'nppdf.so' library

    #include <dlfcn.h>
    #include <iostream>
    using namespace std;
     
    int main()
    {
            cerr << "Loading library..." << endl;
            void *handle = dlopen("/usr/local/Acrobat5/Browsers/intellinux/nppdf.so",
    RTLD_LAZY);
            
            if (handle)
            {
                    cerr << "Unloading library..." << endl;
                    dlclose(handle);
                    return 0;
            }

            cerr << "error: " << dlerror() << endl;

            return 0;
    }

    but when I run this program I get an error
    "/usr/local/Acrobat5/Browsers/intellinux/nppdf.so: undefined symbol:
    XtStrings"

    Any ideas why?

    Do you know any alternative way (without using dlopen()) of loading
    ".so" libs ?

    //////////////////////////////////////////////////////
    Mozilla loads plugins in a following way
    //////////////////////////////////////////////////////
    PRLibrary *dlopen_obj;
        info->dlopen_obj = NULL;
        info->dlopen_obj = NULL;
        if (plugin->dlopen_obj == NULL) {
            plugin->dlopen_obj = PR_LoadLibrary(plugin->filename);
            if (plugin->dlopen_obj == NULL) {
                (NP_CREATEPLUGIN)PR_FindSymbol("NP_CreatePlugin",
    plugin->dlopen_obj);
                (NP_CREATEPLUGIN)PR_FindSymbol(plugin->dlopen_obj,
    "NP_CreatePlugin");
                    int err = PR_UnloadLibrary(plugin->dlopen_obj);
                    plugin->dlopen_obj = NULL;
                f = (NPError(*)(NPNetscapeFuncs *, NPPluginFuncs *))
    PR_FindSymbol("NP_Initialize", plugin->dlopen_obj);
                f = (NPError(*)(NPNetscapeFuncs *, NPPluginFuncs *))
    PR_FindSymbol(plugin->dlopen_obj, "NP_Initialize");
                    int err = PR_UnloadLibrary(plugin->dlopen_obj);
                    plugin->dlopen_obj = NULL;
                    int err = PR_UnloadLibrary(plugin->dlopen_obj);
                    plugin->dlopen_obj = NULL;
                plugin->shutdown = (NPError(*)(void))
    PR_FindSymbol("NP_Shutdown", plugin->dlopen_obj);
                plugin->shutdown = (NPError(*)(void))
    PR_FindSymbol(plugin->dlopen_obj, "NP_Shutdown");
            int err = PR_UnloadLibrary(plugin->dlopen_obj);
            plugin->dlopen_obj = NULL;
    /////////////////////////////////////////////////////
    but I can't find definition of PRLibrary, PR_LoadLibrary(),
    PR_UnloadLibrary() in Mozilla's source code. It seems that plugin is
    loading without dlopen.

    Does anybody know how to load plugins (HOWTO or tutorial)?

    Thanks in advance
    ebleble


  • Next message: Jens.Toerring_at_physik.fu-berlin.de: "Re: Can't load nppdf.so. How to load lib without dlopen()?"

    Relevant Pages

    • Re: [opensuse] How to set up LIRC?
      ... and if not then loading it and setting it to load at boot time. ... I Googled around and learned a bit about loading kernel modules but nothing answered this question. ... Well further Google attempts and a visit to the LIRC website seemed to indicate that I need another module loaded in the kernel called lirc_serial. ...
      (SuSE)
    • Re: Next Version of GDI+ (maybe GDI+ 2.0)
      ... loading and manipulating of such files isn't lightning fast unless you have really powerfull dedicated hardware. ... to see whole image you need to read whole image, and then eventualy generate a smaller sample for display. ... BUT to have this smaler sample you need to load ALL the pixels of oryginal image. ...
      (microsoft.public.dotnet.framework.drawing)
    • Re: Why is java considered a language for "web" or "internet" programming?
      ... I don't remember reading exact things about Perl interpreter, ... load and parse bytecodes. ... I think, integer in Perl or Python or other scripting languages is some structure, with at the least field for type and value, and pointer to this structure you hold in 'i' variable. ... const int NNUM = 1000000; ...
      (comp.lang.java.help)
    • RE: 66 running processes?
      ... Win XP, a firewall and an AV and about seven background utilities, and with ... want it to load right from boot up, or could you take it off the load list ... Stopping programs you use loading early is only likely to make much ...
      (microsoft.public.windowsxp.perform_maintain)
    • Re: Next Version of GDI+ (maybe GDI+ 2.0)
      ... Alejandro Lapeyre ... > loading and manipulating of such files isn't lightning fast unless you ... > smaller sample for display. ... > load ALL the pixels of oryginal image. ...
      (microsoft.public.dotnet.framework.drawing)