Marc Mettes <[EMAIL PROTECTED]> writes: >Marc Mettes wrote: >> >> I'm working on a project embedding and extending perl into a CAD API. >> The API allows for an external executable that communicates through >> an RPC mechanism, or a shared library loaded dynamically. The choice >> is made at link time by the selection of the appropriate library. >> >> I've had great success on Solaris8/gcc with the external executable >> using a statically built perl and everything runs as expected. The >> shared library method using the same perl has caused some problems >> when using C based perl modules. >> >> When using this 'go.pl': >> use Data::Dumper; >> print "hello world", "\n"; >> >> I get the following error message: >> >> Can't load '/usr/perl/lib/5.6.1/sun4-solaris/auto/Data/Dumper/Dumper.so' >> for module Data::Dumper: ld.so.1: /opt/pro/sun4_solaris/obj/pro: fatal: >> relocation error: file >> /usr/perl/lib/5.6.1/sun4-solaris/auto/Data/Dumper/Dumper.so: >> symbol main: referenced symbol not found at >> /usr/perl/lib/5.6.1/sun4-solaris/XSLoader.pm line 75. >> at /usr/perl/lib/5.6.1/sun4-solaris/Data/Dumper.pm line 27 >> Compilation failed in require at go.pl line 5. >> BEGIN failed--compilation aborted at go.pl line 5. >> >> With just the print statement, the script runs just fine. Can someone >> give me some suggestions on resolving this problem? > > >The error complains about a 'main', but which 'main' is it >talking about? In this situation, I don't have a main(). >The main() is in the CAD executable, which loads my shared >library and excutes my user_initialize().
That is the one it talking about. Without the -Bsymbolic the root executable's main would be available to ld.so - I doubt it actually _wants_ main() it is probaly using its address to decide where in virtual memory to put the loaded code (by seeing where that address sits in the page tables or some other OS internals thing... this discussion might be better held on a Solaris specialist list??) You could _try_ defining a main() in your code. (I remember having to do this once and it did help.) -- Nick Ing-Simmons http://www.ni-s.u-net.com/
