Ah, really, come on. I never approach CINT with any preconceptions but
it's very frustrating - very often. Just as for this very code: After I
sent the email I tried for 45minutes now to make CINT swallow it. No
results! I tried every possible trick, dumbed it down to the purest and
simplest things I could think of, all fully ISO compliant with
decreasing complexity. That's what I ended up with (I cannot verify the
code in gcc anymore as I tried to make CINT like it). Took out deque.
Made the vector a string. Took out algorith. Iostream even. A 5 year old
could interpret that. CINT however: Segfault!
I'll try what John suggested and I'm confident that if it worked for him it will for me. But I can compare the "CINT-experience" only to the frustration a web-developer encountered when trying to make webpages for the Internet Explorer still a few years ago. I'm really hoping this awful thing gets a replacement soon because it spoils the actually great
program ROOT.
Robert Hatcher wrote:
>
> On Apr 1, 2010, at 4:36 PM, Cedric Sodhi wrote:
>
>> Hello (again), as if I had made no progress I'm back at that very >> simple file parser that made me contact this mailing list for the >> first time but which I eventually dropped for other reasons. Again, >> ISO compliant code (I know, in terms of CINT that holds no relevance >> at all)
>> and again an error which I dont understand, attached code, error message: >> >> Error: Can't call deque<double,allocator<double> >::deque<double >() >> in current scope auswertung.cpp:9: >> Possible candidates are... >> (in deque<double,allocator<double> >)
>> *** Interpreter error recovered *** >> #include <vector> >> #include <deque> >> #include <iostream> >> #include <fstream> >> #include <sstream> >> #include <algorithm> >> >> std::deque< double >* readCassy( const char *filePath,const >> std::vector< char > &columns ) { >> std::deque< double > *result = new std::deque< double >;
>> std::ifstream inFile( filePath ); >> if( inFile.bad( ) ) >> std::cout << "readCassy: Could not open file '" << filePath << "'" << >> std::endl; >> std::string lastLine = ""; >> std::string lastField = ""; >> double fieldValue = 0.0; >> while( lastLine.find( "\t" )== std::string::npos ) >> std::getline( inFile,lastLine ); >> while( lastLine.find( "\t" )!= std::string::npos ) { >> std::istringstream lineData( lastLine ); >> for( char field = 0; std::getline( lineData,lastField,'\t' ); field++ ) >> if( find( columns.begin( ),columns.end( ),field )!= columns.end( ) ) { >> std::istringstream fieldData( lastField ); >> fieldData >> fieldValue; >> std::cout << fieldValue << " "; >> result->push_back( fieldValue ); >> } >> std::cout << std::endl; >> std::getline( inFile,lastLine ); >> } >> return result; >> } >> >> void auswertung( ) { >> std::vector< char > cols; >> cols.push_back( 1 ); >> cols.push_back( 2 ); >> std::deque< double >* data = readCassy( >> "/home/manday/Documents/University/Physik >> Praktikum/Akustik/cassy/sync2.lab",cols ); >> }
This archive was generated by hypermail 2.2.0 : Fri Apr 02 2010 - 05:50:04 CEST