some more work on userFcn

This commit is contained in:
nemu
2008-06-06 08:42:35 +00:00
parent 6159700e85
commit cc8d9981c3
8 changed files with 172 additions and 12 deletions

View File

@@ -19,12 +19,12 @@ ROOTGLIBS = $(shell $(ROOTSYS)/bin/root-config --glibs)
# linker, and the flags to use
#
OSTYPE = linux
OSTYPE = $(shell uname)
ifeq ($(OSTYPE),linux)
ifeq ($(OSTYPE),Linux)
OS = LINUX
endif
ifeq ($(OSTYPE),linux-gnu)
ifeq ($(OSTYPE),Linux-gnu)
OS = LINUX
endif
ifeq ($(OSTYPE),darwin)
@@ -58,7 +58,8 @@ LIBS = $(ROOTLIBS) -lXMLParser
GLIBS = $(ROOTGLIBS) -lXMLParser
# UserFcn lib
USERFCNLIB = -lTUserFcnBase -lTUserFcn
USERFCNLIB = -lTUserFcnBase
#-lTUserFcn
INSTALLPATH = ./

View File

@@ -36,7 +36,7 @@
#include <cassert>
using namespace std;
#include <TApplication.h>
#include <TSystem.h>
#include <TClass.h>
#include <TString.h>
#include <TTime.h>
@@ -54,9 +54,14 @@ int main(int argc, char *argv[])
{
// check if class is found (argv[1] == class name)
if (!TClass::GetDict("TUserFcn")) {
cout << endl << "**ERROR**: user function class 'TUserFcn' not found.";
cout << endl << endl;
return 0;
cout << endl << "could find TUserFcn, will try to load the shared lib ...";
// try to load the shared library
TString libName = TString("libTUserFcn.so");
if (gSystem->Load(libName.Data())<0) {
cout << endl << "**ERROR**: user function class 'TUserFcn' not found.";
cout << endl << endl;
return 0;
}
}
// generate class object