[xml] dlsym with xmlFree



Hello,

I'm trying to dynamically link to libxml2, something like the following:
        
        void (*gxmlFree)(void *);
 
        void init()
        {
                gxmlFree = dlsym(handle, "xmlFree");
                if(error = dlerror())
                {
                        printf("%s\n",error);
                        return(0);
                }
        }
 
 Is this a valid way of obtaining a pointer to xmlFree()?  I can
successfully
 do this with most of the libxml2 functions, except for the memory
allocation
 functions like, xmlFree, which I need to use with xmlGetProp.
 
 When I use the above function pointer, gxmlFree, I get a segmentation
fault. 

 
  
 Thanks in advance,
 Daniel K. Osawa





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