Can not add my class to root

Wei Xie (xiewei@ceres.weizmann.ac.il)
Mon, 8 Jun 1998 16:51:52 +0200 (EET)


Dear Rooters'

The following code is used to generate a shared library. During the
compilation, it gives some warning messages like:

** Note: operator new() masked 1c
** Note: operator delete() masked 1c
** Warning: Link requested for undefined class ooImp FILE: LINE:0

and finally generate the library "oo.sl". But after I load it into root
using gSystem.Load("oo.sl"), and type :

-- .class test

it shows:

** Error: class,struct,union or type test not defined FILE: LINE:0

Could you tell me what's the problem ?

Sincerely yours

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
name: ooImp.h
^^^^^^^^^^^^^^^
#ifndef main_test
#define main_test

#include <TGFrame.h>

class test: public TGFrame
{
private:
TGFrame *frame;
public:
test(const TGWindow *p,UInt_t w, UInt_t h);
~test();

ClassDef(test,1)

};

#endif

^^^^^^^^^^^^^^^^^^
name: ooImp.c
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#include "ooImp.h"

ClassImp(test)

test::test(const TGWindow *p,UInt_t w, UInt_t h):TGFrame(p,w,h)
{
frame = new TGFrame(gClient->GetRoot(),w,h);
frame->MapWindow();
}

test::~test()
{
delete frame;
}

^^^^^^^^^^^^^^^^^^
Makefile
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

# HP-UX with CC
CXX = CC
CXXFLAGS = -w -g +a1 +Z -I$(ROOTSYS)/include
LD = CC
LDFLAGS = -w -g +a1 -b
OBJS = ooImp.o ooDict.o
SRCS = ooImp.c ooDict.C
PROGRAMS = oo.sl

all: $(PROGRAMS)

$(PROGRAMS): $(OBJS)
$(LD) $(LDFLAGS) $(OBJS) $(ROOTLIBS) -o $(PROGRAMS)
chmod 555 $(PROGRAMS)
@echo "$(PROGRAMS) is done"

clean:
rm -f $(OBJS) ooDict.*

#.SUFFIXES: .c

###

.c.o:
$(CXX) $(CXXFLAGS) -c $<
###############

ooImp.o: ooImp.h
ooDict.C: ooImp.h
@echo "generating dictionary ..."
@rootcint ooDict.C -c ooImp.h