Message: Win7+CMake+VS2012 Static build of Geant4.10.00.p01 Issue Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Win7+CMake+VS2012 Static build of Geant4.10.00.p01 Issue 

Forum: Installation and Configuration
Date: 09 Sep, 2014
From: Hao Yang <Hao Yang>

I have been using Win7+VS2012 shard build of Geant4.10.00.p01 for a long time and there are no issues at all. Recently, I was requested to provide a static build of my application. Thus, I have to build a static Geant. Following the instruction, I changed the flag from BUILD_SHARDED_LIBS TO BUILD_STATIC_LIBS in CMake GUI and Geant4 is been built SUCCESSFULLY. Then I try to build a static version of example B1. I got 32 errors. Most of them are caused by two LINK error shown as below. Please expand the text window for a better view of it. The two errors are LNK2001 and LNK2019, typical "unresolved external symbol". I have no clues how to fix this. There are two questions in my mind.
1) Currently I have both shared build and static build of Geant4 in my machine but in different build directory. Could this cause any of this?
2) I only changed the flag from BUILD_SHARDED_LIBS TO BUILD_STATIC_LIBS in CMake GUI. Is there any other flag I have to change along with it?

Any help will be appreciated. Thanks for your contribution in advance.

Error 889 error LNK2001: unresolved external symbol "__declspec(dllimport) class G4Allocator<class G4CountedObject<void> > * aCountedObjectAllocator" (__imp_?aCountedObjectAllocator@@3PAV?$G4Allocator@V?$G4CountedObject@X@@@@A) C:\Static\B1-build\G4tracking-static.lib(G4VSteppingVerbose.obj) exampleB1
Error 883 error LNK2001: unresolved external symbol "__declspec(dllimport) class G4Allocator<class G4CountedObject<void> > * aCountedObjectAllocator" (__imp_?aCountedObjectAllocator@@3PAV?$G4Allocator@V?$G4CountedObject@X@@@@A) C:\Static\B1-build\G4tracking-static.lib(G4SteppingManager2.obj) exampleB1
Error 882 error LNK2001: unresolved external symbol "__declspec(dllimport) class G4Allocator<class G4CountedObject<void> > * aCountedObjectAllocator" (__imp_?aCountedObjectAllocator@@3PAV?$G4Allocator@V?$G4CountedObject@X@@@@A) C:\Static\B1-build\G4tracking-static.lib(G4SteppingManager.obj) exampleB1
Error 888 error LNK2001: unresolved external symbol "__declspec(dllimport) class G4Allocator<class G4CountedObject<void> > * aCountedObjectAllocator" (__imp_?aCountedObjectAllocator@@3PAV?$G4Allocator@V?$G4CountedObject@X@@@@A) C:\Static\B1-build\G4tracking-static.lib(G4RichTrajectoryPoint.obj) exampleB1
Error 887 error LNK2001: unresolved external symbol "__declspec(dllimport) class G4Allocator<class G4CountedObject<void> > * aCountedObjectAllocator" (__imp_?aCountedObjectAllocator@@3PAV?$G4Allocator@V?$G4CountedObject@X@@@@A) C:\Static\B1-build\G4tracking-static.lib(G4RichTrajectory.obj) exampleB1
Error 873 error LNK2001: unresolved external symbol "__declspec(dllimport) class G4Allocator<class G4CountedObject<void> > * aCountedObjectAllocator" (__imp_?aCountedObjectAllocator@@3PAV?$G4Allocator@V?$G4CountedObject@X@@@@A) C:\Static\B1-build\G4track-static.lib(G4Track.obj) exampleB1
Error 866 error LNK2001: unresolved external symbol "__declspec(dllimport) class G4Allocator<class G4CountedObject<void> > * aCountedObjectAllocator" (__imp_?aCountedObjectAllocator@@3PAV?$G4Allocator@V?$G4CountedObject@X@@@@A) C:\Static\B1-build\G4track-static.lib(G4StepPoint.obj) exampleB1
Error 867 error LNK2001: unresolved external symbol "__declspec(dllimport) class G4Allocator<class G4CountedObject<void> > * aCountedObjectAllocator" (__imp_?aCountedObjectAllocator@@3PAV?$G4Allocator@V?$G4CountedObject@X@@@@A) C:\Static\B1-build\G4track-static.lib(G4Step.obj) exampleB1
Error 862 error LNK2001: unresolved external symbol "__declspec(dllimport) class G4Allocator<class G4CountedObject<void> > * aCountedObjectAllocator" (__imp_?aCountedObjectAllocator@@3PAV?$G4Allocator@V?$G4CountedObject@X@@@@A) C:\Static\B1-build\G4track-static.lib(G4ParticleChangeForTransport.obj) exampleB1
Error 868 error LNK2001: unresolved external symbol "__declspec(dllimport) class G4Allocator<class G4CountedObject<void> > * aCountedObjectAllocator" (__imp_?aCountedObjectAllocator@@3PAV?$G4Allocator@V?$G4CountedObject@X@@@@A) C:\Static\B1-build\G4track-static.lib(G4ParticleChangeForGamma.obj) exampleB1
Error 869 error LNK2001: unresolved external symbol "__declspec(dllimport) class G4Allocator<class G4CountedObject<void> > * aCountedObjectAllocator" (__imp_?aCountedObjectAllocator@@3PAV?$G4Allocator@V?$G4CountedObject@X@@@@A) C:\Static\B1-build\G4track-static.lib(G4ParticleChange.obj) exampleB1
Error 877 error LNK2001: unresolved external symbol "__declspec(dllimport) class G4Allocator<class G4CountedObject<void> > * aCountedObjectAllocator" (__imp_?aCountedObjectAllocator@@3PAV?$G4Allocator@V?$G4CountedObject@X@@@@A) C:\Static\B1-build\G4processes-static.lib(G4VEnergyLossProcess.obj) exampleB1
Error 885 error LNK2001: unresolved external symbol "__declspec(dllimport) class G4Allocator<class G4CountedObject<void> > * aCountedObjectAllocator" (__imp_?aCountedObjectAllocator@@3PAV?$G4Allocator@V?$G4CountedObject@X@@@@A) C:\Static\B1-build\G4processes-static.lib(G4VEmProcess.obj) exampleB1
Error 874 error LNK2001: unresolved external symbol "__declspec(dllimport) class G4Allocator<class G4CountedObject<void> > * aCountedObjectAllocator" (__imp_?aCountedObjectAllocator@@3PAV?$G4Allocator@V?$G4CountedObject@X@@@@A) C:\Static\B1-build\G4processes-static.lib(G4Transportation.obj) exampleB1
Error 890 error LNK2019: unresolved external symbol "__declspec(dllimport) class G4Allocator<class G4ReferenceCountedHandle<void> > * aRCHAllocator" (__imp_?aRCHAllocator@@3PAV?$G4Allocator@V?$G4ReferenceCountedHandle@X@@@@A) referenced in function "public: static void * __cdecl G4ReferenceCountedHandle<class G4VTouchable>::operator new(unsigned int)" (??2?$G4ReferenceCountedHandle@VG4VTouchable@@@@SAPAXI@Z) C:\Static\B1-build\G4processes-static.lib(G4Transportation.obj) exampleB1
Error 876 error LNK2001: unresolved external symbol "__declspec(dllimport) class G4Allocator<class G4CountedObject<void> > * aCountedObjectAllocator" (__imp_?aCountedObjectAllocator@@3PAV?$G4Allocator@V?$G4CountedObject@X@@@@A) C:\Static\B1-build\G4processes-static.lib(G4ScoreSplittingProcess.obj) exampleB1
Error 881 error LNK2001: unresolved external symbol "__declspec(dllimport) class G4Allocator<class G4CountedObject<void> > * aCountedObjectAllocator" (__imp_?aCountedObjectAllocator@@3PAV?$G4Allocator@V?$G4CountedObject@X@@@@A) C:\Static\B1-build\G4processes-static.lib(G4ParallelWorldProcess.obj) exampleB1
Error 870 error LNK2001: unresolved external symbol "__declspec(dllimport) class G4Allocator<class G4CountedObject<void> > * aCountedObjectAllocator" (__imp_?aCountedObjectAllocator@@3PAV?$G4Allocator@V?$G4CountedObject@X@@@@A) C:\Static\B1-build\G4processes-static.lib(G4HadronStoppingProcess.obj) exampleB1
Error 879 error LNK2001: unresolved external symbol "__declspec(dllimport) class G4Allocator<class G4CountedObject<void> > * aCountedObjectAllocator" (__imp_?aCountedObjectAllocator@@3PAV?$G4Allocator@V?$G4CountedObject@X@@@@A) C:\Static\B1-build\G4processes-static.lib(G4HadronicProcess.obj) exampleB1
Error 880 error LNK2001: unresolved external symbol "__declspec(dllimport) class G4Allocator<class G4CountedObject<void> > * aCountedObjectAllocator" (__imp_?aCountedObjectAllocator@@3PAV?$G4Allocator@V?$G4CountedObject@X@@@@A) C:\Static\B1-build\G4processes-static.lib(G4HadronElasticProcess.obj) exampleB1
Error 878 error LNK2001: unresolved external symbol "__declspec(dllimport) class G4Allocator<class G4CountedObject<void> > * aCountedObjectAllocator" (__imp_?aCountedObjectAllocator@@3PAV?$G4Allocator@V?$G4CountedObject@X@@@@A) C:\Static\B1-build\G4processes-static.lib(G4eplusAnnihilation.obj) exampleB1
Error 884 error LNK2001: unresolved external symbol "__declspec(dllimport) class G4Allocator<class G4CountedObject<void> > * aCountedObjectAllocator" (__imp_?aCountedObjectAllocator@@3PAV?$G4Allocator@V?$G4CountedObject@X@@@@A) C:\Static\B1-build\G4processes-static.lib(G4Decay.obj) exampleB1
Error 875 error LNK2001: unresolved external symbol "__declspec(dllimport) class G4Allocator<class G4CountedObject<void> > * aCountedObjectAllocator" (__imp_?aCountedObjectAllocator@@3PAV?$G4Allocator@V?$G4CountedObject@X@@@@A) C:\Static\B1-build\G4processes-static.lib(G4CoupledTransportation.obj) exampleB1
Error 891 error LNK2001: unresolved external symbol "__declspec(dllimport) class G4Allocator<class G4ReferenceCountedHandle<void> > * aRCHAllocator" (__imp_?aRCHAllocator@@3PAV?$G4Allocator@V?$G4ReferenceCountedHandle@X@@@@A) C:\Static\B1-build\G4processes-static.lib(G4CoupledTransportation.obj) exampleB1
Error 864 error LNK2001: unresolved external symbol "__declspec(dllimport) class G4Allocator<class G4CountedObject<void> > * aCountedObjectAllocator" (__imp_?aCountedObjectAllocator@@3PAV?$G4Allocator@V?$G4CountedObject@X@@@@A) C:\Static\B1-build\G4geometry-static.lib(G4PathFinder.obj) exampleB1
Error 865 error LNK2001: unresolved external symbol "__declspec(dllimport) class G4Allocator<class G4CountedObject<void> > * aCountedObjectAllocator" (__imp_?aCountedObjectAllocator@@3PAV?$G4Allocator@V?$G4CountedObject@X@@@@A) C:\Static\B1-build\G4geometry-static.lib(G4Navigator.obj) exampleB1
Error 861 error LNK2001: unresolved external symbol "__declspec(dllimport) class G4Allocator<class G4CountedObject<void> > * aCountedObjectAllocator" (__imp_?aCountedObjectAllocator@@3PAV?$G4Allocator@V?$G4CountedObject@X@@@@A) C:\Static\B1-build\G4geometry-static.lib(G4MultiNavigator.obj) exampleB1
Error 863 error LNK2001: unresolved external symbol "__declspec(dllimport) class G4Allocator<class G4CountedObject<void> > * aCountedObjectAllocator" (__imp_?aCountedObjectAllocator@@3PAV?$G4Allocator@V?$G4CountedObject@X@@@@A) C:\Static\B1-build\G4geometry-static.lib(G4DrawVoxels.obj) exampleB1
Error 886 error LNK2001: unresolved external symbol "__declspec(dllimport) class G4Allocator<class G4CountedObject<void> > * aCountedObjectAllocator" (__imp_?aCountedObjectAllocator@@3PAV?$G4Allocator@V?$G4CountedObject@X@@@@A) C:\Static\B1-build\G4event-static.lib(G4EventManager.obj) exampleB1
Error 872 error LNK2001: unresolved external symbol "__declspec(dllimport) class G4Allocator<class G4CountedObject<void> > * aCountedObjectAllocator" (__imp_?aCountedObjectAllocator@@3PAV?$G4Allocator@V?$G4CountedObject@X@@@@A) C:\Static\B1-build\G4digits_hits-static.lib(G4PSFlatSurfaceFlux.obj) exampleB1
Error 871 error LNK2019: unresolved external symbol "__declspec(dllimport) class G4Allocator<class G4CountedObject<void> > * aCountedObjectAllocator" (__imp_?aCountedObjectAllocator@@3PAV?$G4Allocator@V?$G4CountedObject@X@@@@A) referenced in function "void __cdecl CLHEP::`dynamic initializer for 'gray''(void)" (??__Egray@CLHEP@@YAXXZ) C:\Static\B1-build\G4digits_hits-static.lib(G4PSFlatSurfaceCurrent.obj) exampleB1
Error 892 error LNK1120: 2 unresolved externals C:\Static\B1-build\Release\exampleB1.exe exampleB1

 Add Message Add Message
to: "Win7+CMake+VS2012 Static build of Geant4.10.00.p01 Issue"

 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 ]