RE:Re: question about using stl with cin

Masaharu Goto (MXJ02154@nifty.ne.jp)
Thu, 31 Dec 1998 08:17:54 +0900


Quan,

>Masaharu,
>thanks for replying to my question regarding stl in cint. I got the
>package and I copied the files in $CINTSYSDIR%\lib\stl to
>%ROOTSYS%\lib\stl and $CINTSYSDIR%\stl to %ROOTSYS%\include\stl.

Good. By they way, did you compile vector.dll, string.dll and map.dll?

>What
>I found is that vector related calls work but not all string related
>calls do not. for example, the following string stuff works:
>
>Root > #include <string>
>Root > string s = "Hi!"
>Root > std::cout << s << std::endl

>but if one uses string in a header file such as:
>
>#include <string>
>class Class1 {
>public:
> Class1();
> //...
>
>private:
> string s_MD;
>};
>
>and then generate dictionary files using:
>rootcint class1_dict.cpp -c Class1.h
>I will get an error that says:
>Error: No symbol std::strings_MD in current scope
>there does not appear to be any problem using vector in the above
>mentioned fashion.

I can not reproduce the problem. Above error message comes from cint. And
it complains about std::string. But in the header file , you use string,
not std::string.

Another thing,
There can be some difference between compiled string and interpreted string.
You may need to deal with the difference by masking the string declaration
as follows.

private:
#ifndef __MAKECINT__
string s_Md;
#endif

Masaharu Goto