Re: More problems with CINT

From: Cedric Sodhi <manday_at_gmx.net>
Date: Fri, 2 Apr 2010 00:22:44 +0200


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) 

>
> Ah, not really fair. Yes, CINT plays fast-and-loose a bit. But in
> general actual standard C++ *will* run. I'm not sure CINT is
> necessarily exactly ISO compliant in this case, but I have a simple fix...
>
>> 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> >)

>
> Read this error message. Count to 9.
>
>> *** 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 >;

>
> There is the offending line. Try:
>
> std::deque< double > * result = new std::deque< double >();
>
> From a simple root session:
>
> root [0] #include <deque>
> root [1] std::deque< double > * result = new std::deque< double >;
> Error: Can't call deque<double,allocator<double> >::deque<double >() in
> current scope (tmpfile):1:
> Possible candidates are...
> (in deque<double,allocator<double> >)
> *** Interpreter error recovered ***
> root [2] std::deque< double > * result = new std::deque< double >();
>
> Hmmm, looks like a CINT issue since both, I believe, should be valid.
> If you compiled your macro w/ ACLiC you could test whether the
> compiler thinks your code is on the up-and-up. I.e.
>
> $ root -b -q auswertung.C++
>
> and run with that to avoid any CINT, ah, peculiarities...
>
>> 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 );
>> }

>
> Robert W. Hatcher | rhatcher_at_fnal.gov
> <mailto:rhatcher_at_fnal.gov> 630-840-3102
> FNAL CD/REX (MINOS) | MS 220, PO Box 500, Batavia IL 60510
>
>
>
>

Received on Fri Apr 02 2010 - 00:22:50 CEST

This archive was generated by hypermail 2.2.0 : Fri Apr 02 2010 - 05:50:04 CEST