You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Joel Reed <jr...@support.ddiworld.com> on 2000/03/09 22:22:11 UTC

resolving dynamic library loading issues

Problem: 
	
	when i request a Apache::ASP page i get... 
	error in loading shared library: unresolved symbol foo

why to i get this?

	i use one swig-produced perl package (opal.pm which loads
	libopal.so), libopal.so needs libdbbase.so to resolve 
	symbol foo. for some reason modperl/perl/someone doesn't
	know that it should load libdbbase.so as well.

resolution?

	i think i could use a LD_PRELOAD= but is their a better
	way todo this?

	i'm suprised the perl module loader doesn't see that 
	it needs to load libdbbase.so - is their anyway i can
	encode this information into libopal.so?

thanks for your help. i'm not sure if this is a linker issue, 
apache, modperl, Apache::ASP, or swig. ughh i am lost!

jr


-- 
------------------------------------------------------------------------
Joel W. Reed                              http://ruby.ddiworld.com/jreed
------------------Will Rogers never met the Clintons.------------------

Re: resolving dynamic library loading issues

Posted by Joel Reed <jr...@support.ddiworld.com>.
On Mar 09, jreed@support.ddiworld.com hacked the bitstream to say...
modperl> Problem: 
modperl> 	
modperl> 	when i request a Apache::ASP page i get... 
modperl> 	error in loading shared library: unresolved symbol foo
modperl> 
modperl> why to i get this?
modperl> 
modperl> 	i use one swig-produced perl package (opal.pm which loads
modperl> 	libopal.so), libopal.so needs libdbbase.so to resolve 
modperl> 	symbol foo. for some reason modperl/perl/someone doesn't
modperl> 	know that it should load libdbbase.so as well.
modperl> 
modperl> resolution?
modperl> 
modperl> 	i think i could use a LD_PRELOAD= but is their a better
modperl> 	way todo this?

i found another way to fix this that is perhaps nicer.
the following command builds a nicer .so file:

opal.so : $(libopal_la_OBJECTS) $(libopal_la_DEPENDENCIES)
	$(CXX) -shared -Wl,-soname -Wl,opal.so -o .libs/opal.so \
	$(libopal_la_OBJECTS) -ldbbase -ldbaccess -ldbschema -lpsqlodbc -L/usr/local/pgsql/lib

note the... 

	-ldbbase -ldbaccess -ldbschema -lpsqlodbc -L/usr/local/pgsql/lib

which helps the module loader do the Right Thing(tm).

jr
-- 
------------------------------------------------------------------------
Joel W. Reed                              http://ruby.ddiworld.com/jreed
-----------------------Never trust a skinny cook.-----------------------



Re: resolving dynamic library loading issues

Posted by Joshua Chamas <jo...@chamas.com>.
Joel Reed wrote:
> 
> Problem:
> 
>         when i request a Apache::ASP page i get...
>         error in loading shared library: unresolved symbol foo
> 
> why to i get this?
> 
>         i use one swig-produced perl package (opal.pm which loads
>         libopal.so), libopal.so needs libdbbase.so to resolve
>         symbol foo. for some reason modperl/perl/someone doesn't
>         know that it should load libdbbase.so as well.
> 
> resolution?
> 
>         i think i could use a LD_PRELOAD= but is their a better
>         way todo this?
> 

I think you have a pretty good idea about how to potentially 
resolve the situation, but I wanted to comment that running
under Apache::ASP is no different than mod_perl for module
loading.  What can potentially cause snags is module reloading
when StatINC & StatINCMatch are used, but this will result
in a different set of errors, like perl funcs being undefined,
not loading library errors.

-- Joshua
_________________________________________________________________
Joshua Chamas			        Chamas Enterprises Inc.
NodeWorks >> free web link monitoring	Huntington Beach, CA  USA 
http://www.nodeworks.com                1-714-625-4051