How to use my own library like default ones?


I code a class(comp3exts.h,comp3exts.C) which is needed by some different programs. So, thanks for pepe’s example [url]Trying to compile rootcint dictionary with namespaces I could compile

And I could use it, without #include “comp3exts.h”, as

.L .x mycode.cxx.

But, I would like to use like the default ones , such as TH1, or TF1.

I add #include “comp3exts.h” into mycode.cxx, without .L before .x mycode.cxx, mycode.cxx does not work properly and shows [quote]Error: comp3exts() declared but not defined [/quote]

I copied comp3exts.h and comp3exts.C to …/root/include/ and to …/root/lib/, unfortunately, this did not work neither.

Then I run “make -f Makefile”, thanks for kalliopi’s post [url]Makefile compile time difference between slc5 and 6 this time I got a bigger But it acts the same as the previouse one.

After that , I tried to make …/root/test/Makefile, but it seems some libraries are missing

[quote]…/root/test/…/lib/ undefined reference to EVP_sha1' ...//root/test/../lib/ undefined reference toSSL_CTX_new’
…/root/test/…/lib/ undefined reference to SSL_set_fd' .../root/test/../lib/ undefined reference toSSL_CTX_use_certificate_chain_file’
…/root/test/…/lib/ undefined reference to `SSL_shutdown’[/quote]

I also found something here There are some words [quote]Of course you will need to add the include path for ROOT, and you might have to link against ROOT’s libraries libCore libCint.[/quote] I am not sure, but it seems I need to do somethings about libCore and libCint(makefile??) in order to use my class as the default library.

I hope someone could tell me how to solve this or give me some hints.

comp3exts.h, LinkDef.h, small Makefile have been uploaded.

Thanks for your help.

comp3exts.h (758 Bytes)
LinkDef.h (151 Bytes)

SOURCES = comp3exts.C
HEADERS = comp3exts.h
FLAGS = -O -Wall -fPIC root-config --cflags root-config --ldflags
GLIBS = root-config --glibs
INC = -Iroot-config --incdir

suffix rule


define the final target


comp3exts_dict.C: (HEADERS) LinkDef.h rootcint -f @ -c -g $^ comp3exts_dict.C (SOURCES) g++ -shared -o @ (FLAGS) (GLIBS) -g (INC) ^

rm _dict.[/code]