RE:streams with CInt

Valery Fine (fine@mail.cern.ch)
Thu, 23 Oct 1997 10:19:57 +0100


On 22 Oct 97 at 18:59, William J. Deninger wrote:

> Ooops, one more thing..
>
> root[0] Simple s;
>
> (crash!!!)
>
I would like to mention that the posted Makefile ( and that from
root/test may be simplify if all you want is to create a SINGLE DLL
to load it into intercative ROOT session via ".L" or gSystem.Load.

For this "trivial" case the Makefil (for Windows) follows"

Where are differences:

1. Line to define CXXFLAGS was

CXXFLAGS = $(cvarsdll) /Zd /O2 /G5 /MD -D_WINDOWS -I$(ROOTSYS)/include

should be

CXXFLAGS = $(cvarsdll) /LD /Zd /O2 /G5 /MD -D_WINDOWS -I$(ROOTSYS)/include

2. The rule to create DLL is more simple and looks like

$(SIMPLESO): $(SIMPLEO)
$(LD) $(SOFLAGS) $(SIMPLEO) Simple.exp $(LIBS) $(OutPutOpt)Simple.dll

instead of the "universal" 3-steps:

$(EVENT): $(EVENTO)
BINDEXPLIB Event $(EVENTO) > Event.def
lib /nologo /MACHINE:IX86 $(EVENTO) /def:Event.def $(OutPutOpt)$(EVENTLIB)
$(LD) $(SOFLAGS) $(EVENTO) Event.exp $(LIBS) $(OutPutOpt)Event.dll
@echo "Event.dll done"

=================

But I want to highlight it works for the trivial case ONLY: To
produce a SINGLE DLL to load it into the ROOT interactive session.
===========
One can no apply this for stand-alone ROOT-like program with
pre-compiled objects !

# ===================== Begin ===========
ObjSuf = obj
SrcSuf = cxx
ExeSuf = .exe
DllSuf = dll
OutPutOpt = /out:

# Win32 system with Microsoft Visual C/C++
!include <win32.mak>
CC = $(cc)
CXX = $(cc)
CXXFLAGS = $(cvarsdll) /LD /Zd /O2 /G5 /MD -D_WINDOWS -I$(ROOTSYS)/include
LD = $(link)
LDFLAGS = $(conlflags)
SOFLAGS = $(dlllflags)
ROOTLIBS = $(ROOTSYS)/lib/*.lib
LIBS = $(ROOTLIBS) $(guilibsdll) MSVCIRT.LIB
LIBSALL = $(ROOTLIBS)
SIMPLELIB = Simple.lib

#------------------------------------------------------------------------------

SIMPLEO = Simple.$(ObjSuf) SimpleCint.$(ObjSuf)

SIMPLES = Simple.$(SrcSuf) SimpleCint.$(SrcSuf)

SIMPLESO = libSimple.$(DllSuf)

OBJS = $(SIMPLEO)

PROGRAMS = $(SIMPLE)

DLLS = $(SIMPLESO)

all: $(DLLS) $(PROGRAMS)

$(SIMPLESO): $(SIMPLEO)
$(LD) $(SOFLAGS) $(SIMPLEO) Simple.exp $(LIBS) $(OutPutOpt)Simple.dll
@echo "SIMPLE.dll done"

clean:
@del /q $(OBJS) SimpleCint.$(SrcSuf) SimpleCint.h

###

SimpleCint.$(SrcSuf): Simple.h LinkDef.h
@echo "Generating dictionary ..."
@rootcint -f SimpleCint.$(SrcSuf) -c Simple.h LinkDef.h

.$(SrcSuf).$(ObjSuf):
$(CXX) $(CXXFLAGS) -c $<

Dr. Valeri Faine (Valery Fine)
------------ ------------- Phone: +41 22 767 4921
CERN FAX : +41 22 767 7155
CH-1211 Geneva, 23 mailto:fine@mail.cern.ch
Switzerland http://nicewww.cern.ch/~fine