[ROOT] Re:

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu Nov 06 2003 - 09:03:38 MET


Hi Chris,

I have modified your Makefile and added a LinkDef file to declare
your global pointer. See attachements

Rene

PS: when sending mails to roottalk, specify a mail subject. This will facilitate
my life, many readers life and the search engine life ::)

jillings@caltech.edu wrote:
> 
> Rene,
>     I did (I think!) as you suggested. Do I need a special LinkDef to
> link on a global? (Is there a list of pragma's somewhere?)
>     When I put the real declaration (ie no extern qualifier)
> A* gAptr;
> in to A.h I got mulitiple definitions on linking.
>     When I put the extern statement in A.h, nothing changed. That is the
> code as attached?
> 
> Thanks very much,
> 
> Chris
> 
> PS: Root 3/04_02 although I've had the same problem on a 3/05 as well.
> Running Linux 2.4.18-27.7.xsmp #1 SMP
> 
> --
> 
> ********************************
> Chris Jillings
> Kellogg Radiation Laboratory
> California Institute of Technology
> jillings@caltech.edu
> http://www.krl.caltech.edu/~jillings
> ********************************
> 
>   --------------------------------------------------------------------------------
>               Name: A.cc
>    A.cc       Type: unspecified type (APPLICATION/OCTET-STREAM)
>           Encoding: BASE64
>        Description: "A.cc"
> 
>              Name: A.h
>    A.h       Type: unspecified type (APPLICATION/OCTET-STREAM)
>          Encoding: BASE64
>       Description: "A.h"
> 
>               Name: B.cc
>    B.cc       Type: unspecified type (APPLICATION/OCTET-STREAM)
>           Encoding: BASE64
>        Description: "B.cc"
> 
>              Name: B.h
>    B.h       Type: unspecified type (APPLICATION/OCTET-STREAM)
>          Encoding: BASE64
>       Description: "B.h"
> 
>                   Name: Makefile
>    Makefile       Type: unspecified type (APPLICATION/OCTET-STREAM)
>               Encoding: BASE64
>            Description: "Makefile"
> 
>                   Name: abexe.cc
>    abexe.cc       Type: unspecified type (APPLICATION/OCTET-STREAM)
>               Encoding: BASE64
>            Description: "abexe.cc"

CXX           = g++
CXXFLAGS      = -O0 -g -Wall -fPIC -Wno-deprecated
LDFLAGS       = -O0 -g
SOFLAGS       = -shared -O0 -g
LD            = g++

ROOTCFLAGS   := $(shell root-config --cflags)
ROOTLIBS     := $(shell root-config --libs)
ROOTGLIBS    := $(shell root-config --glibs)

CXXFLAGS    += $(ROOTCFLAGS)

HDRS          = A.h B.h 

SRCS          = A.cc B.cc

OBJS          = A.o B.o ABdict.o

LIBRARY       = libAB.so 

lib:	$(LIBRARY)

clean:         
	rm -f *.o *.so ABdict.C ABdict.o ABdict.h 

$(LIBRARY):     $(OBJS)
	$(LD) $(SOFLAGS) $(OBJS) -o $(LIBRARY)

ABdict.C: $(HDRS) 
	@echo "Generating dictionary ..."
	@rootcint -f ABdict.C -c $(HDRS) LinkDef.h

exe:	abexe.cc
	$(CXX) $(CXXFLAGS) -c abexe.cc -o abexe.o
	$(LD) $(LDFLAGS) abexe.o -L./ -lAB \
	$(ROOTLIBS) $(ROOTGLIBS) -o abexe


#ifdef __CINT__

#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;

#pragma link C++ global gAptr;
#pragma link C++ class A+;
#pragma link C++ class B+;

#endif



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:16 MET