Hi,
I recently upgraded my computer from Suse 9.2, gcc 3.3.5, root 5.10/00 to Suse 10.1, gcc 4.1 and root 5.12/00a.
Now, when I try to compile one of my class, there is a error:
Info in : creating shared library /home/fabio/PolarimeterSimulatorRND+VER+SHELL+DIR/SimPol/./TCompound_cpp.so
/home/fabio/PolarimeterSimulatorRND+VER+SHELL+DIR/SimPol/./fileXM0WqD.cxx: In function ‘int G__fileXM0WqD_1418_6_0(G__value*, const char*, G__param*, int)’:
/home/fabio/PolarimeterSimulatorRND+VER+SHELL+DIR/SimPol/./fileXM0WqD.cxx:342: error: invalid cast from type ‘std::vector<TString, std::allocator >’ to type ‘long int’
g++: /home/fabio/PolarimeterSimulatorRND+VER+SHELL+DIR/SimPol/./fileXM0WqD.o: No such file or directory
Error in : Compilation failed!
The class is:
TCompound.h
#ifndef TCOMPOUND_HH
#define TCOMPOUND_HH
#include
#include
#include
#define COMPOUNDS_FILE “./COMPOUNDS.DAT”
/// \brief Class describing a chemical compound.
class TCompound {
public:
TCompound(TString COMPOUND_NAME, Bool_t VERBOSE=1);
~TCompound();
inline TString GetCompoundName() {return CompoundName;}
inline Double_t GetFraction() {return Fraction;}
inline void SetFraction(Double_t FRACTION) {Fraction = FRACTION;}
inline Int_t GetnElementsInCompound() {return nElementsInCompound;}
inline std::vector GetElementsInCompound() {return ElementsInCompound;}
inline std::vector<Int_t> GetnAtomsInCompound() {return nAtomsInCompound;}
private:
Bool_t Verbose;
TString CompoundName;
Double_t Fraction;
Int_t nElementsInCompound;
std::vector ElementsInCompound;
std::vector<Int_t> nAtomsInCompound;
};
#endif
TCompound.cpp
#include “TCompound.h”
//*******************************************************************************
/// \brief Basic constructor. *
//*******************************************************************************
TCompound::TCompound(TString COMPOUND_NAME, Bool_t VERBOSE)
{
Verbose = VERBOSE;
CompoundName = “NONE”;
// Open the file containing the compound informations and skip the file header…
ifstream CompoundsFile;
CompoundsFile.open(COMPOUNDS_FILE);
TString Dummy = “”;
while (Dummy != “BEGIN:”) CompoundsFile >> Dummy;
// Read the compound properties.
TString ElementTemp;
Int_t nAtomsTemp;
while (!CompoundsFile.eof()){
CompoundsFile >> CompoundName;
CompoundsFile >> nElementsInCompound;
for (Int_t i=0; i> ElementTemp;
ElementsInCompound.push_back(ElementTemp);
CompoundsFile >> nAtomsTemp;
nAtomsInCompound.push_back(nAtomsTemp);
}
if (CompoundName == COMPOUND_NAME){
CompoundsFile.close();
if (Verbose){
std::cout << "Compound name: " << CompoundName << std::endl;
std::cout << "Number of elements: " << nElementsInCompound << std::endl;
for (Int_t j=0; j<nElementsInCompound; j++){
std::cout << "Element: " << ElementsInCompound[j] << ", ";
std::cout << "number of atoms: " << nAtomsInCompound[j] << std::endl;
}
}
return;
}
else{
ElementsInCompound.clear();
nAtomsInCompound.clear();
}
}
// If the compound is not available…
std::cout << COMPOUND_NAME << " is not available. Please edit by hand the file " <<
COMPOUNDS_FILE << std::endl;
CompoundsFile.close();
CompoundName = “NONE”;
return;
}
//*******************************************************************************
/// \brief Basic destructor. *
//*******************************************************************************
TCompound::~TCompound()
{
}
Any suggestion?
Thanks in advance.
Fabio