Re: Syntax error while initializing a variable

From: Axel Naumann <Axel.Naumann_at_cern.ch>
Date: Wed, 29 Nov 2006 16:52:01 +0100


Hi,

the fix for all but static bool b1(false) is now in CVS. I've sent you a work-around for b1(false) by private mail.

Cheers, Axel.

OKUMURA, Akira wrote:

> Hello Axel,
> 
> The attached tgz is a short example. Please check it with the following
> simple commands.
> 
> $ tar zxvf test.tgz
> $ cd test
> $ make
> 
> CCfits/*.h are put in test/include/CCfits.
> 
> Sincerely,
> 
> OKUMURA, Akira oxon_at_icrr.u-tokyo.ac.jp
> Institute for Cosmic Ray Research, University of Tokyo
> 5-1-5 Kashiwanoha Kashiwa Chiba 277-8582 Japan
> Phone/Fax : +81 4-7136-3153
> Skype : okumura.akira
> 
> On 2006/11/28, at 2:43, Axel Naumann wrote:
> 

>> Hi,
>>
>> could you send a piece of code that I can run rootcint on that shows
>> this error?
>>
>> Cheers, Axel.
>>
>> OKUMURA, Akira wrote:
>>> Hello ROOTers,
>>>
>>> I think the following two expressions are same:
>>> static const double d1(0);
>>> static const double d1 = 0;
>>>
>>> But when I generate a dictionary of my classes, rootcint outputs syntax
>>> errors,
>>>
>>> $ make
>>> (..........)
>>> rootcint -f src/APGAnalysisDict.cxx -c -p include/APGEvent.h
>>> include/APGEventDisplay.h include/APGEventHeader.h
>>> include/APGRawDataFile.h include/APGRunHeader.h include/LinkDef.h
>>> Syntax error /ashra/home/oxon/include/CCfits/FITSUtil.h:310:
>>> Syntax error /ashra/home/oxon/include/CCfits/FITSUtil.h:311:
>>> Syntax error /ashra/home/oxon/include/CCfits/FITSUtil.h:315:
>>> Syntax error /ashra/home/oxon/include/CCfits/FITSUtil.h:316:
>>> Syntax error /ashra/home/oxon/include/CCfits/FITSUtil.h:317:
>>> Syntax error /ashra/home/oxon/include/CCfits/FITSUtil.h:318:
>>> Syntax error /ashra/home/oxon/include/CCfits/FITSUtil.h:319:
>>> Syntax error /ashra/home/oxon/include/CCfits/FITSUtil.h:320:
>>> Syntax error /ashra/home/oxon/include/CCfits/FITSUtil.h:321:
>>> Syntax error /ashra/home/oxon/include/CCfits/FITSUtil.h:322:
>>> Syntax error /ashra/home/oxon/include/CCfits/FITSUtil.h:323:
>>> Warning: Error occurred during reading source files
>>> Warning: Error occurred during dictionary source generation
>>> !!!Removing src/APGAnalysisDict.cxx src/APGAnalysisDict.h !!!
>>> Error: rootcint: error loading headers...
>>>
>>> CCfits is external package which was coded by others. And APG*.{h,cxx}
>>> are my own codes.
>>>
>>> Only APGRawDataFile.h includes <CCfits/FITSUtil.h>. This header has 14
>>> lines which cause this syntax errors.
>>>
>>> static const double d1(0);
>>> static const float f1(0);
>>> static const std::complex<float> c1(0.);
>>> static const std::complex<double> d2(0.);
>>> static const string s1("");
>>> static const int i1(0);
>>> static const unsigned int u1(0);
>>> static const long l1(0);
>>> static const unsigned long ul1(0);
>>> static const LONGLONG ll1(0);
>>> static const short s2(0);
>>> static const unsigned short us1(0);
>>> static const bool b1(false);
>>> static const unsigned char b2(0);
>>>
>>> I added a line as a test before #include in APGRawDataFile.h.
>>> static const double a(0);
>>> #include <CCfits/FITSUtil.h>
>>>
>>> However this additional line was not detected as a syntax error.
>>>
>>> If CCfits is my own package, of course I will modify the above 14 lines
>>> like as "d1(0)" -> "d1 = 0". But it is a package which was coded by
>>> other developers. Therefore I would not like to change the code.
>>>
>>> Is there any solution from ROOT side?
>>>
>>> RH7.3, gcc 3.4.5, ROOT 5.08
>>>
>>> Sincerely,
>>>
>>> OKUMURA, Akira oxon_at_icrr.u-tokyo.ac.jp
>>> Institute for Cosmic Ray Research, University of Tokyo
>>> 5-1-5 Kashiwanoha Kashiwa Chiba 277-8582 Japan
>>> Phone/Fax : +81 4-7136-3153
>>> Skype : okumura.akira
>>>
>>>
>>
>>

> Received on Wed Nov 29 2006 - 16:52:16 MET

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:32:02 MET