You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by Staffan Tjernstrom <st...@gmail.com> on 2010/09/07 12:47:13 UTC

Cannot dynamically load a library that in turn links to the libxerces-c.so

I'm trying to dlopen a library that in turn uses libxerces-c to do sax2
parsing.

However, as soon as I add the

#include <xercesc/sax2/Attributes.hpp>
#include <xercesc/sax2/DefaultHandler.hpp>
#include <xercesc/sax2/SAX2XMLReader.hpp>
#include <xercesc/sax2/XMLReaderFactory.hpp>
#include <xercesc/util/PlatformUtils.hpp>

to the code in the applicaiton .so, and then add the -lxerces-c to the LDADD
clause in my Makefile.am, I get a "Permisison Denied" error from my dlopen()
call.

Any ideas?

Do I somehow have to generate a static library for xerces-c and link my
dynamically loaded .so against that?

If so, how do I go about doing that from the src rpm? I've looked around but
cant' quite spot the magic incantation to use when calling runConfigure.

Re: Cannot dynamically load a library that in turn links to the libxerces-c.so

Posted by Vitaly Prapirny <ma...@mebius.net>.
Staffan Tjernstrom wrote:
> I'm trying to dlopen a library that in turn uses libxerces-c to do sax2
> parsing.
>
> However, as soon as I add the
>
> #include<xercesc/sax2/Attributes.hpp>
> #include<xercesc/sax2/DefaultHandler.hpp>
> #include<xercesc/sax2/SAX2XMLReader.hpp>
> #include<xercesc/sax2/XMLReaderFactory.hpp>
> #include<xercesc/util/PlatformUtils.hpp>
>
> to the code in the applicaiton .so, and then add the -lxerces-c to the LDADD
> clause in my Makefile.am, I get a "Permisison Denied" error from my dlopen()
> call.
>
> Any ideas?

It should work. Maybe you do not have enough permissions?

Good luck!
	Vitaly

Re: Cannot dynamically load a library that in turn links to the libxerces-c.so

Posted by brijesh singh <ge...@gmail.com>.
Hi Staffan,

Can I know which platform are you building your dll?
If its UNIX please can you check ldd/chatr on your shared object and give me
the o/p?

Thanks and Regards
-Brijesh

On Tue, Sep 7, 2010 at 4:17 PM, Staffan Tjernstrom <st...@gmail.com>wrote:

> I'm trying to dlopen a library that in turn uses libxerces-c to do sax2
> parsing.
>
> However, as soon as I add the
>
> #include <xercesc/sax2/Attributes.hpp>
> #include <xercesc/sax2/DefaultHandler.hpp>
> #include <xercesc/sax2/SAX2XMLReader.hpp>
> #include <xercesc/sax2/XMLReaderFactory.hpp>
> #include <xercesc/util/PlatformUtils.hpp>
>
> to the code in the applicaiton .so, and then add the -lxerces-c to the
> LDADD
> clause in my Makefile.am, I get a "Permisison Denied" error from my
> dlopen()
> call.
>
> Any ideas?
>
> Do I somehow have to generate a static library for xerces-c and link my
> dynamically loaded .so against that?
>
> If so, how do I go about doing that from the src rpm? I've looked around
> but
> cant' quite spot the magic incantation to use when calling runConfigure.
>