Re: Shared libraries using MakeC++sharedLib on AIX 4.1

Rene Brun (Rene.Brun@cern.ch)
Fri, 20 Feb 1998 11:05:37 +0100


Denis,
In your Makefile below, you use testbench.sl (not .so).
Could you check?
In your program, when you do
gSystem->Load("testbench.so);
what is the return value?
If the return value is not zero, you should check if your
implementation file includes all the functions declared in your
header files.
I need to see your LinkDef.h file including the names of the classes
to be processed by rootcint.
See a complete example in $ROOTSYS/test/Event.
Contact me directly (not the list).

Rene Brun

Denis Bertini wrote:
>
>
> Hello,
> I have tried to create a Shared Library using the exec
> MakeC++sharedLib on AIX 4.1 and this is the makefile
> (it does work !) that i run :
>
> # options de compilation
> ifeq ($(OS),AIX)
> CXX = xlC
> CXXFLAGS = -w -O -qnoro -qnoroconst -qmaxmem=-1 -I$(ROOTSYS)/include
> LD = xlC
> LDFLAGS = -g -w -bloadmap
> endif
>
> #
> ifeq ($(OS),HP-UX)
> CXXFLAGS = -w -g +a1 +Z -I$(ROOTSYS)/include
> LDFLAGS = -w -g +a1 -b
> LD = CC
> CXX = CC
> endif
>
> #
>
> HDRS = TTBElement.h TTBTestBench.h testbench.h
> SRCS = TTBElement.C TTBTestBench.C testbench.C
> OBJS = TTBElement.o TTBTestBench.o testbench.o
>
> # load root's libs
>
> ROOTLIBS = -L$(ROOTSYS)/lib -lRoot -lCint
> LIBS = $(ROOTLIBS) -lm -lcurses
> GLIBS = $(LIBS) -lXm -lXt -lX11 -lPW -lld
>
> PROGRAM = testbench.sl
> all: $(PROGRAM)
> $(PROGRAM): $(OBJS)
> @echo "Linking $(PROGRAM) ..."
> @/bin/rm -f $(PROGRAM)
> /usr/lpp/xlC/bin/makeC++SharedLib -p 1 -o $(PROGRAM)
> $(LIBS) $(OBJS)
> @chmod -w+x $(PROGRAM)
> @echo "done"
> clean:
> @/bin/rm -f $(OBJS) core
> ###
> TTBElement.o: TTBElement.h
> TTBTestBench.o: TTBTestBench.h
> testbench.C: TTBElement.h TTBTestBench.h
> @echo "Generating dictionary ..."
> @/bin/rm -f testbench*
> @rootcint testbench.C -c TTBElement.h TTBTestBench.h
>
> **************************************************************
>
>
> this makefile run and create the shared object testbench.so.
> On root this library can be loaded but does not implement
> the new classes !
>
> Something wrong in it ?
>
> BERTINI Denis
>