Problem with STL vector header file

Hi,
I recently started using root in a different manner than I had been, namely compiling a macro inside the root shell; previously I had always made stand alone apps to do the heavy crunching.

I’m having trouble using the vector class when compiling inside ROOT. If I :

#include

in a module I’m compiling I get:

root [2] .x anal1.C
Info in TUnixSystem::ACLiC: creating shared library /home/kwd1/evdo/ethereal/LinkAnal_C.so
“/bld/kwd1/root/3.10/root/cint/lib/prec_stl/vector”, line 441: (in preprocessor if): syntax error
Warning: #pragma link, function operator==(std::vector::iterator&,std::vector::iterator&) not found FILE:/bld/kwd1/root/3.10/root/cint/lib/prec_stl/vector LINE:175
Warning: #pragma link, function operator!=(std::vector::iterator&,std::vector::iterator&) not found FILE:/bld/kwd1/root/3.10/root/cint/lib/prec_stl/vector LINE:176
Warning: #pragma link, function operator<(std::vector::iterator&,std::vector::iterator&) not found FILE:/bld/kwd1/root/3.10/root/cint/lib/prec_stl/vector LINE:177
Warning: #pragma link, function operator>(std::vector::iterator&,std::vector::iterator&) not found FILE:/bld/kwd1/root/3.10/root/cint/lib/prec_stl/vector LINE:178
Warning: #pragma link, function operator<=(std::vector::iterator&,std::vector::iterator&) not found FILE:/bld/kwd1/root/3.10/root/cint/lib/prec_stl/vector LINE:179
Warning: #pragma link, function operator>=(std::vector::iterator&,std::vector::iterator&) not found FILE:/bld/kwd1/root/3.10/root/cint/lib/prec_stl/vector LINE:180
10001
20002

and the program seems to run anyway. However, If I try and declare a vector, it won’t comple. The code is attached.

thanks for your help
Ken

PS I’m hoping ot write an talk about how to use ROOT. Talk is aimed at non scientists. I’ll forward it along. Is the above technique the standard way to make a compiled application in ROOT?
anal1.C (115 Bytes)
LinkAnal.C (2.33 KB)
LinkAnal.h (625 Bytes)

Indeed, these warning can be safely ignored.

[quote]However, If I try and declare a vector, it won’t comple. The code is attached. [/quote]What is the error?

Philippe.

Hi,
if I uncomment out the
vector protocols;

line in the .C file, I get:

root [9] .x anal1.C
Warning in : unmodified script has already been compiled and loaded
Warning in : it will be regenerated and reloaded!
Info in TUnixSystem::ACLiC: creating shared library /home/kwd1/evdo/ethereal/LinkAnal_C.so
"/bld/kwd1/root/3.10/root/cint/lib/prec_stl/vector", line 441: (in preprocessor if): syntax error
Warning: #pragma link, function operator==(std::vector::iterator&,std::vector::iterator&) not found FILE:/bld/kwd1/root/3.10/root/cint/lib/prec_stl/vector LINE:175
Warning: #pragma link, function operator!=(std::vector::iterator&,std::vector::iterator&) not found FILE:/bld/kwd1/root/3.10/root/cint/lib/prec_stl/vector LINE:176
Warning: #pragma link, function operator<(std::vector::iterator&,std::vector::iterator&) not found FILE:/bld/kwd1/root/3.10/root/cint/lib/prec_stl/vector LINE:177
Warning: #pragma link, function operator>(std::vector::iterator&,std::vector::iterator&) not found FILE:/bld/kwd1/root/3.10/root/cint/lib/prec_stl/vector LINE:178
Warning: #pragma link, function operator<=(std::vector::iterator&,std::vector::iterator&) not found FILE:/bld/kwd1/root/3.10/root/cint/lib/prec_stl/vector LINE:179
Warning: #pragma link, function operator>=(std::vector::iterator&,std::vector::iterator&) not found FILE:/bld/kwd1/root/3.10/root/cint/lib/prec_stl/vector LINE:180
dlopen error: ld.so.1: /bld/kwd1/root/3.10/root/bin/root.exe: fatal: relocation
error: file /home/kwd1/evdo/ethereal/LinkAnal_C.so: symbol _1cH__rwstdUInterlockedDecrement6Fpl_l: referenced symbol not found
Load Error: Failed to load Dynamic link library /home/kwd1/evdo/ethereal/LinkAnal_C.so
Undefined first referenced
symbol in file
main /aopt/sc8.0b/SUNWspro/prod/lib/crt1.o
ld: fatal: Symbol referencing errors. No output written to /home/kwd1/evdo/ethereal/jbaXjayBm
*** Interpreter error recovered ***
root [10]

You’re right, I can declare a vector. My problem seems to be related to the string class.
thakns
Ken

Most likely the flags used by ACLiC in this case are not correct for your environment :frowning:

You should first try to see if you can generate a shared library with your code outside of the ROOT environment.

Philippe.

PS. ROOT 3/10 is now relatively old, you may want to try ROOT 5/10.