STL vector iterator and ACLiC problem

Hello!
I have two problems, and it is not unlikely I’m just doing something wrong.

I use in a macro a (STL) vector of Long64_t (see attachment).
When I try running the function in it, I get an obscure error:

CINT/ROOT C/C++ Interpreter version 5.16.16, November 24, 2006
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] .L STLVectorTest.C
root [1] STLVectorTest("LTest")
Error: cannot open file "long.so" Error: cannot open file "long.so"  defalloc.h:157:
Error: operator '/' divided by zero defalloc.h:157:
Error: cannot open file "long.so" Error: cannot open file "long.so"  defalloc.h:131:
*** Interpreter error recovered ***

Fine. Well, not that fine, indeed.
Then I try to do a thing I never did, i.e. to compile the macro with… ACLiC?
I hope it works out of the box, because I wouldn’t be able to correct anything…

root [2] .L STLVectorTest.C+
Info in <ACLiC>: script has already been loaded in interpreted mode
Info in <ACLiC>: unloading STLVectorTest.C and compiling it
Info in <TUnixSystem::ACLiC>: creating shared library STLVectorTest_C.so
fileBR6Q7a.cxx: In function 'int G__fileBR6Q7a__0_1238(G__value*, const char*, G__param*, int)':
fileBR6Q7a.cxx:69: error: expected primary-expression before 'long'
fileBR6Q7a.cxx:69: error: expected `)' before 'long'
x86_64-pc-linux-gnu-g++: fileBR6Q7a.o: No such file or directory
Error in <ACLiC>: Compilation failed!

After some hard times figuring how to get that temporary file which is erased, I find that the error line is:

G__letint(result7, 105, (long) TEventList* STLVectorTest((const char*) G__int(libp->para[0])));

It seems that some parser has not parsed the STLVectorTest(const char*) definition correctly, probably not recognising the return type of the function (with void* it does work).

I’m stuck, since trying to go around a CINT limitation I feel like I got a ACLiC limitation.

Suggestions?
Thank you.


Hamlet

P.S. I’ve just found that with Int_t the CINT part works well… maybe it’s just the vector<Long64_t> which is not supported? It would be proper in cases as in the example, where event positions in tree are Long64_t.
I’m not stuck animore (I could even use the void* workaround to compile), but the two questions are still valid.

P.P.S. Using a Gentoo box, gcc 4.1.1, ROOT 5.14.00c (the latest “production” version)
STLVectorTest.C (675 Bytes)

Hi,

Indeed the dictionary for std::vector<Long64_t> is not provided by default (aka you need to generate the dictionary yourself if you need it from the command line).

[quote]After some hard times figuring how to get that temporary file which is erased, I find that the error line is:[/quote]Set gDebug to 7 and it will keep the temporary file around.

[quote]It seems that some parser has not parsed the STLVectorTest(const char*) definition correctly, probably not recognising the return type of the function (with void* it does work). [/quote]I think this is a weakness in the autoloader in the version of Root you are using. Simply make sure that rootcint can see the TEventList.h header file.

Cheers,
Philippe.