Re: use of '#define FOO' in macro

From: OKUMURA, Akira <oxon_at_icrr.u-tokyo.ac.jp>
Date: Fri, 25 May 2007 02:36:37 -1000


Hello ROOTers,

'-p' option given to rootcint seems to prevent my code from using global macro. I wrote simple test codes which had some '#define' constants and compiled them using '-p' option of rootcint. I could not access such constants from interpreter but I could do it if I delete '-p'.

However in my original code which was linked to CCFITS needs '-p' because a declaration of bool in its header cannot be handled by CINT correctly.
(see http://root.cern.ch/root/roottalk/roottalk06/1562.html)

Any suggestion?

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 2007/05/23, at 5:00, OKUMURA, Akira wrote:

> Hello ROOTers,
>
> I found an old post in roottalk.
> http://root.cern.ch/root/roottalk/roottalk98/2493.html
> I tried this but I still get 'Error: Symbol SHORT_IMG is ...'.
>
> I added
> #defined SHORT_IMG 16
> in FITSfunction.h, and
> #pragma link C++ global SHORT_IMG;
> in FITSLinkDef.h .
>
> These two headers correspond to CERNfunction.h and CERNLinkDef.h
> (see http://root.cern.ch/root/HowtoCERNLIB.html)
>
> 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 2007/05/22, at 17:44, OKUMURA, Akira wrote:
>
>> Hello ROOTers
>>
>> I compiled my original ROOT according to the web page
>> http://root.cern.ch/root/HowtoCERNLIB.html
>> It was compiled with the library CCfits (C++ FITS library).
>>
>> One of its headers has some #define lines such as
>> #define BYTE_IMG 8
>> #define SHORT_IMG 16
>> #define LONG_IMG 32
>>
>> If I use these constants in my macro, I get an error.
>> root [0] .x test.C
>> Error: Symbol SHORT_IMG is not defined in current scope
>> cookbook.C:114:
>> *** Interpreter error recovered ***
>>
>> but
>> root [0] .x test.C+
>> runs as I expected.
>>
>> Is it possible to use #define constants of the library in my macro
>> without compiling? Is there any solution?
>>
>> 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 Fri May 25 2007 - 14:37:43 CEST

This archive was generated by hypermail 2.2.0 : Fri Jun 01 2007 - 17:50:02 CEST