RE: Template function in LinkDef.h

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Fri, 27 Jun 2008 20:26:59 -0500


Hi,

In the linkdef statement you might need to give the exact parameter type including the const-ness. So try:

#pragma link C++ function THealAlmMapTools::Map2Alm(const THealPix&,
THealAlm<Float_t>&,const std::vector<Double_t>&, Bool_t);

if this does not work, try without the std::

Cheers,
Philippe.

-----Original Message-----
From: owner-roottalk_at_root.cern.ch [mailto:owner-roottalk_at_root.cern.ch] On Behalf Of OKUMURA, Akira
Sent: Friday, June 27, 2008 6:05 PM
To: ROOT Talk
Subject: [ROOT] Template function in LinkDef.h

Hello ROOTers,

I get warnings when I create a dictionary for my library.

$ rootcint -f src/RootHealPixDict.cxx -c -p include/THealAlm.h include/ THealAlmMapTools.h include/THealFFT.h include/THealPix.h include/ THealUtil.h include/LinkDef.h
Warning: #pragma link, function
Map2Alm(THealPix&,THealAlm<Float_t>&,std::vector<Double_t>&,Bool_t) not found include/LinkDef.h:56:
Warning: #pragma link, function
Map2Alm(THealPix&,THealAlm<Double_t>&,std::vector<Double_t>&,Bool_t) not found include/LinkDef.h:57:

Because of this warnings, I cannot call THealAlmMapTools::Map2Alm from the root command line even though I succeeded in loading my library. These functions are written in THealAlmMapTools.h and .cxx. I do not understand why only Alm2Map works while Map2Alm doesn't.

How should I modify my codes? I am using ROOT 5.20.00 on Mac OS X Leopard (Intel).

namespace THealAlmMapTools {

   template<typename T> void Alm2Map(const THealAlm<T>& alm, THealPix& map);

   template<typename T> void Map2Alm(const THealPix& map, THealAlm<T>& alm, const std::vector<Double_t>& weight, Bool_t add_alm); }

namespace THealAlmMapTools {

template<typename T> void Alm2Map(const THealAlm<T>& alm, THealPix& map) {
(snip)
}
template<typename T> void Map2Alm(const THealPix& map, THealAlm<T>& alm, const std::vector<Double_t>& weight, Bool_t add_alm) {
(snip)
}

template void Alm2Map(const THealAlm<Float_t>& alm, THealPix& map);
template void Alm2Map(const THealAlm<Double_t>& alm, THealPix& map);
template void Map2Alm(const THealPix& map, THealAlm<Float_t>& alm,  
const std::vector<Double_t>& weight, Bool_t add_alm); template void Map2Alm(const THealPix& map, THealAlm<Double_t>& alm, const std::vector<Double_t>& weight, Bool_t add_alm);

}
Regards,

OKUMURA, Akira oxon_at_ceres.phys.s.u-tokyo.ac.jp Department of Physics, The University of Tokyo 7-3-1 Hongo, Bunkyo-ku, Tokyo 113-0033
TEL/FAX +81 3-5841-4173/4059
Skype : okumura.akira Received on Sat Jun 28 2008 - 03:31:54 CEST

This archive was generated by hypermail 2.2.0 : Sat Jun 28 2008 - 05:50:08 CEST