I am trying to build a very simple NSAPI plugin for a Netscape
Enterprise server running on SunOS. To do this, I have built a
little C++ test program that, unfortunatley refuses to load.
What I am doing is a little bit Netscape specific, but I think
that the problem I am experiencing is something more related
to UNIX shared libraries, and ldopen, than to Netscape as such.
So please disregard the fact that Netscape is involved and tell
me if I'm doing something very wrong when I am creating my .so
This is the error message that the server gives me when
I try to start the server (use the shared library):
conf_init: Error running init function(late) load-modules: dlopen of
/opt/netscape/suitespot/https-jaco/example.so failed (ld.so.1: ns-httpd:
fatal: relocation error: file
__1cDstdZ__RTTI__1nDstdJbad_alloc__: referenced symbol not found)
server exit: status 1
The code is compiled like this:
CC -G -DNET_SSL -DSOLARIS -D_REENTRANT -DMCC_HTTPD -DXP_UNIX -DSPAPI20
-KPIC -mt -I/opt/netscape/suitespot/include
-I/opt/netscape/suitespot/include/frame example.cpp -h example.so -o
And the source looks like this:
#include "nsapi.h" //Netscape stuff
using namespace std;
// The problem goes away if I do not use a map. However I
// must do so... :-(
extern "C" NSAPI_PUBLIC int hello_client(pblock *param, Session *sn,
map<string, string, less<string> > myMap;
myMap["test"] = "Hello world";
Compiler: CC: WorkShop Compilers 5.0 98/12/15 C++ 5.0
Platform: SunOS v5.6
Netscape server: Netscape-Enterprise v3.5.1
I have tried to set the LD_LIBRARY_PATH but it did not help.
The shared library loads if I do not use STL or any other
libraries. Any tips or ideas about what I am doing wrong would
be greatly appreciated.
Software developer / Netch Technologies AB / Lund / Sweden.
Sent via Deja.com http://www.deja.com/
Before you buy.