Message: Compiling LEND physics lsit and linking to it Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Compiling LEND physics lsit and linking to it 

Forum: Installation and Configuration
Date: 25 Jan, 2012
From: Elena Novikova <Elena Novikova>

I am in Windows-7, I am using Visual Studio 2008 Express (which is rather close to the 'officially tested' platform "Windows7 with Visual C++ 10.0 / Visual Studio 2010" and to the 'verified configuration' Windows/XP with Visual C++ 9.0 / Visual Studio 2008). I was successful creating the workspace (aka "solution" in new VS terminology) that included Geant4 ver. 9.5 library project and my "driver" project with my main, my geometry etc.

I put together the "solution" (*.sln) Visual Studio file from scratch, and the geant4 library *.vcproj file from scratch as well. (These are the files that do the job of "make" in Visual Studio.)

I was able to compile and ran my project with several physics setups, including such physics lists as QGSP_BERT_HP, LHEP, QGSP_INCL_ABLA, LBE and many other lists provided in source/physics_lists/lists/include folder.

However, here is my problem. When I am trying to compile a project that calls for instantiation (from templates) of any code that relates to LEND physics (examples are: "Shielding" physics class and any class that requires G4PhysListFactory), I am getting linking errors, all pointing to the calls made in file xData.cc from source/processes/hadronic/models/lend/src folder. Example:

error LNK2019: unresolved external symbol __imp__XML_ParserCreate referenced in function _xData_parseInitialize

XML_ParserCreate is a function defined in file xmlparse.cc which is one of the files I included into my Geant4 library project. This file DID compile, so I do not understand why the linker cannot find this symbol (as well as a few others from the same xmlparse.cc file).

One caveat... I HAD to edit xmlparse.cc file to force it to compile. I was getting the following errors:

1>.\geant4_9_5\source\externals\expat\src\xmlparse.cc(1493) : error C2440: '=' : cannot convert from 'XML_Status' to 'XML_Error'
1>        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast)
1>.\geant4_9_5\source\externals\expat\src\xmlparse.cc(1497) : error C2440: '=' : cannot convert from 'XML_Status' to 'XML_Error'
1>        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast)
1>.\geant4_9_5\source\externals\expat\src\xmlparse.cc(1500) : error C2440: 'return' : cannot convert from 'XML_Error' to 'XML_Status'
1>        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast)
1>.\geant4_9_5\source\externals\expat\src\xmlparse.cc(1535) : error C2440: 'return' : cannot convert from 'XML_Error' to 'XML_Status'
1>        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast)

To get rid of those errors, I edited the xmlparse.cc code in the following way:

line 1493, from 
        result = XML_STATUS_SUSPENDED;
to
        result = static_cast<XML_Error>(XML_STATUS_SUSPENDED);  // ein casting

line 1497, from 
        result = XML_STATUS_OK;
to
        result = static_cast<XML_Error>(XML_STATUS_OK); // ein casting

line 1500, from
          return result;
to
          return static_cast<XML_Status>(result); // ein casting

line 1535, from 
    return result;
to
    return static_cast<XML_Status>(result); // ein casting

I do not believe that my editing outlined above resulted in the trouble I am experiencing, i.e., inability to "link" any project where instantiation of LEND physics is required.

Please help me to figure out how to get the XML expat parser to "link" to the rest of the project(s), so that I can use LEND physics...

Sincerely,

--Elena Novikova.

Naval Research Laboratory

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

1 Question: Re: Compiling LEND physics lsit and linking to it   (Ben Morgan - 30 Jan, 2012)
(_ Ok: Re: Compiling LEND physics lsit and linking to it   (Elena Novikova - 03 Feb, 2012)
(_ Note: Re: Compiling LEND physics lsit and linking to it   (Ben Morgan - 06 Feb, 2012)
 Add Message Add Message
to: "Compiling LEND physics lsit and linking to it"

 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 ]