Message: Compilation error in client application with Geant4.10.2 Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Compilation error in client application with Geant4.10.2 

Forum: Installation and Configuration
Date: 09 May, 2016
From: Paola Ferrario <Paola Ferrario>

Hi,

I'm having troubles compiling my Geant4-based application with Geant4.10.2, while it compiled using versions up to 10.1.p03. I managed to install Geant4.10.2 without problems in my laptop, running OS X Yosemite 10.10.2, with XCode 6.4 and Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn). When I compile my application, with the -std=c++11 flag, it gives me the following error in the NexusApp class, which is attached, related to the G4AnyMethod class, when I use the DeclareMethod method of the G4GenericMessenger class:

In file included from /Users/paola/Software/geant4.10.02.p01/include/Geant4/G4GenericMessenger.hh:36:
/Users/paola/Software/geant4.10.02.p01/include/Geant4/G4AnyMethod.hh:185:12: error: invalid operands to binary expression ('std::stringstream'
      (aka 'basic_stringstream<char>') and 'nakedA0' (aka 'const G4String'))
      strs >> a0;
      ~~~~ ^  ~~
/Users/paola/Software/geant4.10.02.p01/include/Geant4/G4AnyMethod.hh:177:5: note: in instantiation of member function 'G4AnyMethod::FuncRef1<void,
      nexus::NexusApp, const G4String &>::operator()' requested here
    FuncRef1(S (T::*f)(A0)) : fRef(f) {}
    ^
/Users/paola/Software/geant4.10.02.p01/include/Geant4/G4AnyMethod.hh:88:20: note: in instantiation of member function 'G4AnyMethod::FuncRef1<void,
      nexus::NexusApp, const G4String &>::FuncRef1' requested here
    fContent = new FuncRef1<S,T,A0>(f);
                   ^
source/base/NexusApp.cc:35:40: note: in instantiation of function template specialization 'G4AnyMethod::G4AnyMethod<void, nexus::NexusApp, const
      G4String &>' requested here
  _msg->DeclareMethod("RegisterMacro", &NexusApp::RegisterMacro, ""); 
                                       ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/istream:200:20: note: candidate function not
      viable: no known conversion from 'nakedA0' (aka 'const G4String') to 'std::__1::basic_istream<char> &(*)(std::__1::basic_istream<char> &)' for 1st
      argument
    basic_istream& operator>>(basic_istream& (*__pf)(basic_istream&));

(...)

Could anyone give me a hint on what the problem could be? It seems to me that the DeclareMethod function needs a different argument than with previous versions of geant4, but I'm not sure which one is that. Has anything changed with the way messengers are given configuration parameters? Thanks a lot

Paola

   Attachment:
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2016/05/09/08.09-9479-NexusApp.cc

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Question: Re: Compilation error in client application with Geant4.10.2   (Paola Ferrario - 16 May, 2016)
 Add Message Add Message
to: "Compilation error in client application with Geant4.10.2"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]