Hi, I am new to ROOT and had a few problems with using the STL vector/map class. I am using ROOT 3.10. My problem is that I am not able to access a typedef of a vector/map inside root. My classes are like this ************************** // Dataset.h #include <string> #include <map> #include <vector> #ifdef __CINT__ #pragma link C++ class std::vector<std::string>; #pragma link C++ class std::map<std::string, std::string>; #pragma link C++ dset::Dataset::IdList; #endif namespace dset { class Dataset { public: // typedefs typedef std::string Name; typedef std::map<std::string, std::string> Row; typedef std::vector<std::string> IdList; private: ------- ------- }; } ************************** // DatasetLinkDef.h - generated by makefile #ifdef __CINT__ #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; #pragma link off all typedefs; #pragma link C++ defined_in <here i specify the location of header file Dataset.h> #pragma link C++ nestedclasses; #pragma link C++ nestedtypedefs; #endif ************************** There are several such classes and there's a Makefile which creates the <class>LinkDef.h file automatically for each class in the package. There is also a program which sets up the environment and loads all the class libraries using gSystem->load() during root startup. When i start root, I am able to use the "dset::Dataset::Name" typdef For eg: root [0] dset::Dataset::Name name; root [1] name = "abc"; (string 0x8d13f48)"abc" root [2] cout << abc << endl; abc But when I use the other two typedefs, I get an error 1] root [9] dset::Dataset::IdList lst; Error: Symbol IdListlst is not defined in current scope FILE:(tmpfile) LINE:1*** Interpreter error recovered *** 2] root [10] dset::Dataset::Row row; Error: Symbol Rowrow is not defined in current scope FILE:(tmpfile) LINE:1 *** Interpreter error recovered *** Doubt: I saw in one of your threads (on the root mailing list) that a similar bug was fixed in the latest version of root (v4.0). Is there a solution for this in the version that I am using (v3.10)? Is there something else I need to do for these typedefs to be recognized in root? Any comments would be very helpful. Thank you for your time, Regards, Vinay Sambamurthy
This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:10 MET