Hi All,
In an effort to create my owm, ROOT-based executables I seem to miss an
important detail of some sort. I try to do this on an SGI machine (IRIX
6.4 with a 32 bit flag on) with a gnu compiler.
I can compile my program (which is included as an attachment) but when I
try to run it it gives a Segmentation Violation.
It seems that this violation is related to output that is written to a
canvas.
Evidently I must be missing some init-function or perhaps a library, but
I can't really tell which it should be then.
What am I missing ?
Thanx,
Sven Schagen
PS: I also included the Makefile that I use to compile it.
-- **********************************************************************Sven E.S. Schagen Zeus Analysis Bladmoshof 6 NIKHEF Amsterdam 1441 LN Purmerend Kruislaan 409 The Netherlands 1098 SJ Amsterdam (0)299 436995 The Netherlands (0)20 592 5025
Student of Physics, Don't turn your back on your friend, University of Amsterdam no matter what! (schagen@beta.uva.nl) -Call Upon My Brothers Ignite
********************************************************************** --------------726F8B5296357D2894A09624 Content-Type: application/x-unknown-content-type-cfile; name="CalcEff.C" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="CalcEff.C"
I2luY2x1ZGUgPFRIMS5oPg0KDQp2b2lkIENhbGNFZmYoVEgxRiBoaXN0MSwgVEgxRiBoaXN0 MiwgVEgxRiAmaGlzdDMpDQp7DQovKiBDYWxjRWZmIDogVGhpcyBtYWNybyBjYWxjdWxhdGVz IHRoZSBlZmZpY2llbmN5IGFuZCB0aGUgZXJyb3Igb24gdGhlIA0KICoJICAgICB0aGUgaGlz dG8yIC8gaGlzdG8xIGFuZCB3cml0ZXMgaXQgdG8gaGlzdG8zLiBBbHNvIHRoZSBlcnJvcnMN CiAqICAgICAgICAgICBhcmUgY2FsY3VsYXRlZC4NCiAqIFZlcnNpb24gOiAxLjAwIDA2IDA1 IDE5OTgNCiAqIEF1dGhvciAgOiBTdmVuIFNjaGFnZW4NCiAqLw0KCWNoYXIgKmR1bW15Ow0K CWhpc3QzLkRpdmlkZSgmaGlzdDIsJmhpc3QxLChmbG9hdCkxLjAsKGZsb2F0KTEuMCxkdW1t eSk7DQoNCglJbnRfdCBiaW5zID0gaGlzdDEuR2V0TmJpbnNYKCk7DQoNCglEb3VibGVfdCBl cnJvcltiaW5zXTsNCg0KCWZvcihJbnRfdCBpID0gMDsgaSA8IGJpbnM7ICsraSkNCgl7DQoJ CUZsb2F0X3QgaDEgPSBoaXN0MS5HZXRCaW5Db250ZW50KGkpOw0KCQlGbG9hdF90IGgyID0g aGlzdDIuR2V0QmluQ29udGVudChpKTsNCgkJZXJyb3JbaV0gPSAoc3FydCgoaDEgLSBoMSkq aDIvaDEpL2gxKTsNCgl9DQoJaGlzdDMuU2V0RXJyb3IoKGRvdWJsZSAqKWVycm9yKTsNCn0N Cg0K --------------726F8B5296357D2894A09624 Content-Type: text/plain; charset=us-ascii; name="Makefile" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="Makefile"
ObjSuf = o SrcSuf = C ExeSuf = DllSuf = so EVENTLIB = $(EVENTO) OutPutOpt = -o
ROOTLIBS = -L$(ROOTSYS)/lib -lBase -lCint -lClib -lCont -lFunc -lGraf \ -lGraf3d -lHist -lHtml -lMeta -lMinuit -lNet -lPostscript \ -lProof -lTree -lUnix -lZip -lRint ROOTGLIBS = -lGpad -lGX11 -lMotif -lWidgets -lX3d
# SGI with GCC CXX = /usr/gnu/bin/g++ CXXFLAGS = -fsigned-char -fPIC -w -I$(ROOTSYS)/include LD = /usr/gnu/bin/g++ LDFLAGS = -g -Wl,-u,__builtin_new -Wl,-u,__builtin_delete -Wl,-u,__nw__FUiPv SOFLAGS = -Wl,-soname,libEvent.so -shared LIBS = $(ROOTLIBS) -lg++ -lm -ldl GLIBS = $(ROOTLIBS) $(ROOTGLIBS) $(ROOTLIBS)-lXm -lXt -lX11 -lg++ -lm -lPW -ldl
#------------------------------------------------------------------------------
OBJS = CalcEff.o mcTest.o
test: $(OBJS) $(LD) $(LDFLAGS) $(OBJS) $(LIBS) $(GLIBS) -o testje
CalcEff.o: CalcEff.C $(CXX) $(CXXFLAGS) -c CalcEff.C -o CalcEff.o @echo "CalcEff done"
mcTest.o: mcTest.C CalcEff.h $(CXX) $(CXXFLAGS) -c mcTest.C -o mcTest.o @echo "mcTest done"
--------------726F8B5296357D2894A09624 Content-Type: application/x-unknown-content-type-cfile; name="mcTest.C" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="mcTest.C"
I2luY2x1ZGUgIm15cm9vdC5oIg0KI2luY2x1ZGUgIkNhbGNFZmYuaCINCg0KDQp2b2lkIG1h aW4oKQ0Kew0KCXByaW50ZigiV2VsY29tZSB0byBtY1Rlc3QuQ1xuIik7DQoJVENoYWluICpt Y2RhdGEgPSBuZXcgVENoYWluKCJoMSIpOw0KCQ0KCUludF90IG50cms7DQoJRmxvYXRfdCB0 aGVfdHJrWzUwXTsNCglJbnRfdCBzbGVfdHJrWzUwXTsNCglJbnRfdCBtY3NlX3Rya1s1MF07 DQoNCglUSDFGICpoaXN0MSA9IG5ldyBUSDFGKCJoaXN0MSIsIm1jc2UiLDMwMCwwLDMpOw0K CVRIMUYgKmhpc3QyID0gbmV3IFRIMUYoImhpc3QyIiwic2xlIiwzMDAsMCwzKTsNCglUQ2Fu dmFzICpjMSA9IG5ldyBUQ2FudmFzKCJjMSIsImMxIiw2MDAsNjUwKTsNCg0KLy8gVGhlIHBy b2dyYW0gZW5kcyBzb21ld2hlcmUgaGVyZS4gV2hlbiBJIGhhZCB0aGUgVENhbnZhcyBzdGF0 ZW1lbnQgDQovLyBwbGFjZWQgaW4gYSBsYXRlciBwYXJ0IG9mIHRoZSBwcm9ncmFtLCBqdXN0 IGJlZm9yZSB0aGUgaGlzdDMuRHJhdywNCi8vIHRoZSBwcm9ncmFtIGZhaWxlZCB0aGVyZS4N Cg0KDQoJcHJpbnRmKCJBZGRpbmcgZGF0YSB0byBjaGFpblxuIik7DQoJbWNkYXRhLT5BZGQo Ii4uL290aGVyL21jZGlzOTZfMDMucm9vdCIpOw0KCQ0KCXByaW50ZigiU2V0dGluZyBCcmFu Y2ggQWRkcmVzc2VzXG4iKTsNCgltY2RhdGEtPlNldEJyYW5jaEFkZHJlc3MoIm50cmsiLCZu dHJrKTsNCgltY2RhdGEtPlNldEJyYW5jaEFkZHJlc3MoInRoZV90cmsiLHRoZV90cmspOw0K CW1jZGF0YS0+U2V0QnJhbmNoQWRkcmVzcygic2xlX3RyayIsc2xlX3Ryayk7DQoJbWNkYXRh LT5TZXRCcmFuY2hBZGRyZXNzKCJtY3NlX3RyayIsbWNzZV90cmspOw0KDQoJSW50X3QgbmV2 ZW50cyA9IG1jZGF0YS0+R2V0RW50cmllcygpOw0KDQoJcHJpbnRmKCJFbnRlcmluZyBMb29w XG4iKTsNCglmb3IoSW50X3QgaSA9IDA7IGkgPCBuZXZlbnRzOyBpKyspDQoJew0KCQltY2Rh dGEtPkdldEV2ZW50KGkpOw0KCQlmb3IoSW50X3QgaiA9IDA7IGogPCBudHJrOyBqKyspDQoJ CXsNCgkJCWlmKG1jc2VfdHJrW2pdPT0xKQ0KCQkJew0KCQkJCWhpc3QxLT5GaWxsKHRoZV90 cmtbal0pOw0KCQkJCWlmKHNsZV90cmtbal09PTEpDQoJCQkJew0KCQkJCQloaXN0Mi0+Rmls bCh0aGVfdHJrW2pdKTsNCgkJCQl9DQoJCQl9DQoJCX0NCgl9DQoJVEgxRiAqaGlzdDMgPSBu ZXcgVEgxRigiaGlzdDMiLCJlZmYiLDMwMCwwLDMpOw0KDQoJQ2FsY0VmZigqaGlzdDEsKmhp c3QyLCpoaXN0Myk7DQoJcHJpbnRmKCJFZmYgY2FsY3VsYXRlZFxuIik7DQoNCglUUGFkICpw YWQxID0gbmV3IFRQYWQoInBhZDEiLCJwYWQxIiwwLjAyLDAuMDIsMC45OCwwLjk4LDEwKTsN CglwYWQxLT5EcmF3KCk7DQoNCgloaXN0My0+RHJhdygiZTFwIik7DQp9CQ0KDQo= --------------726F8B5296357D2894A09624 Content-Type: application/x-unknown-content-type-hfile; name="myroot.h" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="myroot.h"
Ly8gT05MWSBJTkxDVURFIFRISVMgSU4gVEhFIE1BSU4gUFJPR1JBTSBGSUxFDQovLyBPVEhF UldJU0UsIFVTRSBST09USU5DUy5IDQoNCiNpbmNsdWRlICJUUk9PVC5oIg0KI2luY2x1ZGUg IlRBcHBsaWNhdGlvbi5oIg0KI2luY2x1ZGUgIlRDaGFpbi5oIg0KI2luY2x1ZGUgIlRQYXZl TGFiZWwuaCINCiNpbmNsdWRlICJURmlsZS5oIg0KI2luY2x1ZGUgIlRIMS5oIg0KI2luY2x1 ZGUgIlROdHVwbGUuaCINCiNpbmNsdWRlICJUUGFkLmgiDQojaW5jbHVkZSAiVFByb2ZpbGUu aCINCiNpbmNsdWRlICJUR3JhcGguaCINCiNpbmNsdWRlICJUR3JhcGhFcnJvcnMuaCINCiNp bmNsdWRlICJUVHJlZS5oIg0KI2luY2x1ZGUgIlRTeXN0ZW0uaCINCiNpbmNsdWRlICJUTGVh Zi5oIg0KI2luY2x1ZGUgIlRBdHRGaWxsLmgiDQojaW5jbHVkZSAiVEF0dE1hcmtlci5oIg0K I2luY2x1ZGUgIlRBdHRMaW5lLmgiDQojaW5jbHVkZSAiVEF0dEF4aXMuaCINCiNpbmNsdWRl ICJUQ2FudmFzLmgiDQojaW5jbHVkZSAiVE9iamVjdC5oIg0KDQpleHRlcm4gdm9pZCBJbml0 R3VpKCk7IC8vIGxvYWRzIHRoZSBkZXZpY2UgZGVwZW5kZW50IGdyYXBoaWNzIHN5c3RlbQ0K Vm9pZEZ1bmNQdHJfdCBpbml0ZnVuY3NbXSA9IHtJbml0R3VpLCAwIH07DQppbnQgRXJyb3I7 CS8vIG5lZWRlZCBiaWogTW90aWYNCg0KVFJPT1Qgcm9vdCgiTXlSb290IiwiU3ZlbidzIFJP T1QiLGluaXRmdW5jcyk7DQo= --------------726F8B5296357D2894A09624--