Re: CINT (ROOT v5.30) does not compile class with static const members

From: Axel Naumann <Axel.Naumann_at_cern.ch>
Date: Wed, 25 Apr 2012 14:06:15 +0200


Hi,

Could you try with a more recent version of ROOT? I believe this was fixed in the meantime.

Cheers, Axel.

On 04/25/2012 02:02 PM, Neal Gauvin wrote:

> Hi,
> 
> Thanks for your answer.
> What you say would work if I had a non const member...
> But here I have a static const.
> 
> Cheers,
> 
> Neal
> 
> 
> Le 25/04/2012 13:56, Timur Pocheptsov a écrit :

>> You have to declare static member in .h (remove initializer) and
>> define it in .C file.
>> ________________________________________
>> From: owner-roottalk_at_root.cern.ch [owner-roottalk_at_root.cern.ch] on
>> behalf of Neal Gauvin [Neal.Gauvin_at_unige.ch]
>> Sent: 25 April 2012 13:46
>> To: roottalk (Mailing list discussing all aspects of the ROOT system.)
>> Subject: [ROOT] CINT (ROOT v5.30) does not compile class with static
>> const members
>>
>> Hi,
>>
>> I wrote a class, which contains a static const member.
>> The class compiles finely with g++, but CINT fails to compile it.
>>
>> Info in<TUnixSystem::ACLiC>: creating shared library
>> /home/gauvin/Polar/europe_svn/trunk/include/./test_C.so
>> dlopen error: /home/gauvin/Polar/europe_svn/trunk/include/./test_C.so:
>> undefined symbol: _ZN4test10common_limE
>> Load Error: Failed to load Dynamic link library
>> /home/gauvin/Polar/europe_svn/trunk/include/./test_C.so
>> /usr/lib/gcc/x86_64-redhat-linux/4.6.3/../../../../lib64/crt1.o: In
>> function `_start':
>> (.text+0x20): undefined reference to `main'
>> /home/gauvin/Polar/europe_svn/trunk/include/test_C_ACLiC_dict.o: In
>> function `G__setup_memvartest()':
>> test_C_ACLiC_dict.cxx:(.text+0xde3): undefined reference to
>> `test::common_lim'
>> collect2: ld a retourné 1 code d'état d'exécution
>>
>> You can find the demo class in attachment.
>> I am using ROOT version 5.30.
>> The same code is found to work on ROOT version v5.26
>>
>> Does somebody have any Idea what goes wrong ?
>>
>> Thanks in advance,
>>
>> Neal
>>
>> --
>> _______________________________________________
>>
>> Dr. Neal Gauvin
>> E-mail neal.gauvin_at_a3.epfl.ch
>> -----------------------------------------------
>> Data Centre for Astrophysics (ISDC)
>> Chemin d'Ecogia 16
>> CH-1290 Versoix
>> Phone : +41 22 379 2108
>> _______________________________________________
>>

>
> Received on Wed Apr 25 2012 - 14:07:06 CEST

This archive was generated by hypermail 2.2.0 : Wed Apr 25 2012 - 17:50:02 CEST