Dear Sir/Madam: I have a Ubuntu 12.04 64 bit linux system(2CPUs). Several days ago, I successfully installed the Geant4.9.6 and everything is OK. I tried to build the basic example B1 in Geant4.9.6. I successfully used cmake to build example B1 (command is shown as follows). ---------command----------- sudo cmake -DGeant4_DIR=/home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/Geant4-9.6.2/ /home/yunzhongfan107/Program/Geant4/geant4.9.6/examples/basic/B1 --------------------------- However, when I tried to use 'sudo make -j2' to continue my building process, I have some problems. The error information is shown as follows: --------error information------ Scanning dependencies of target exampleB1 [ 16%] [ 33%] Building CXX object CMakeFiles/exampleB1.dir/exampleB1.cc.o Building CXX object CMakeFiles/exampleB1.dir/src/B1RunAction.cc.o [ 50%] Building CXX object CMakeFiles/exampleB1.dir/src/B1PrimaryGeneratorAction.cc.o [ 66%] Building CXX object CMakeFiles/exampleB1.dir/src/B1DetectorConstruction.cc.o [ 83%] Building CXX object CMakeFiles/exampleB1.dir/src/B1SteppingAction.cc.o [100%] Building CXX object CMakeFiles/exampleB1.dir/src/B1EventAction.cc.o Linking CXX executable exampleB1 /home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/libG4OpenGL.so: error: undefined reference to 'XtStrings' /home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/libG4OpenGL.so: error: undefined reference to 'XtShellStrings' /home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/libG4OpenGL.so: error: undefined reference to 'XtVaCreateManagedWidget' /home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/libG4OpenGL.so: error: undefined reference to 'XtVaGetValues' /home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/libG4OpenGL.so: error: undefined reference to 'XtVaCreateWidget' /home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/libG4OpenGL.so: error: undefined reference to 'XtVaSetValues' /home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/libG4OpenGL.so: error: undefined reference to 'XtAddCallbacks' /home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/libG4OpenGL.so: error: undefined reference to 'XtManageChild' /home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/libG4OpenGL.so: error: undefined reference to 'XtCreateManagedWidget' /home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/libG4OpenGL.so: error: undefined reference to 'XtAddCallback' /home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/libG4OpenGL.so: error: undefined reference to 'XtParent' /home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/libG4OpenGL.so: error: undefined reference to 'XtAppAddTimeOut' /home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/libG4OpenGL.so: error: undefined reference to 'XtRemoveTimeOut' /home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/libG4OpenGL.so: error: undefined reference to 'XtRealizeWidget' /home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/libG4OpenGL.so: error: undefined reference to 'XtPopup' /home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/libG4OpenGL.so: error: undefined reference to 'XtDestroyWidget' /home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/libG4OpenGL.so: error: undefined reference to 'topLevelShellWidgetClass' /home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/libG4OpenGL.so: error: undefined reference to 'XtVaCreatePopupShell' /home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/libG4OpenGL.so: error: undefined reference to 'XtScreen' /home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/libG4OpenGL.so: error: undefined reference to 'XtNameToWidget' /home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/libG4OpenGL.so: error: undefined reference to 'XtWindow' /home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/libG4OpenGL.so: error: undefined reference to 'XtWidgetToApplicationContext' /home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/libG4OpenGL.so: error: undefined reference to 'XtDisplay' /home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/libG4OpenGL.so: error: undefined reference to 'XtAppCreateShell' /home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/libG4OpenInventor.so: error: undefined reference to 'XtDispatchEvent' /home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/libG4OpenInventor.so: error: undefined reference to 'XtUnmanageChild' /home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/libG4OpenInventor.so: error: undefined reference to 'XtSetValues' /home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/libG4OpenInventor.so: error: undefined reference to 'XtMalloc' /home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/libG4OpenInventor.so: error: undefined reference to 'XtFree' /home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/libG4OpenInventor.so: error: undefined reference to 'XtSetSensitive' /home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/libG4OpenInventor.so: error: undefined reference to 'XtAddEventHandler' /home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/libG4interfaces.so: error: undefined reference to 'XtIsSubclass' /home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/libG4interfaces.so: error: undefined reference to 'XtAppNextEvent' /home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/libG4interfaces.so: error: undefined reference to 'XtAppInitialize' /home/yunzhongfan107/Program/Geant4/geant4.9.6-install/lib/libG4interfaces.so: error: undefined reference to 'XtSetMappedWhenManaged' collect2: ld returned 1 exit status make[2]: *** [exampleB1] Error 1 make[1]: *** [CMakeFiles/exampleB1.dir/all] Error 2 make: *** [all] Error 2 --------------------------- You can see the attachment for details. Could anyone give me some suggestions about how to solve these problems please? Thank you for your help. Sincerely Yours Yue
Created attachment 222 [details] Screen Shot of the building commands for basic example B1
Hi Yue, Could you let us know the cmake settings you used to configure Geant4 itself, and also the output when you build example B1 with the command 'make -j2 VERBOSE=1' please? The latter is most important as this should display the full commands used to compile and link the executable. Cheers, Ben.
(In reply to comment #2) > Hi Yue, > > Could you let us know the cmake settings you used to configure Geant4 itself, > and also the output when you build example B1 with the command 'make -j2 > VERBOSE=1' please? The latter is most important as this should display the full > commands used to compile and link the executable. > > Cheers, > > Ben. Hi, Ben, Thank you for your reply. I have already fixed the problem by reinstall my Ubuntu 12.04 system on my desktop. Rather than installing the latest Geant4 software, I install Geant4.9.5.p02 instead. Right now, everything is fine and I successfully compiled example B1 and B2 on my system. If I have further problems, I will let you know and thanks again for your help. Sincerely Yours Yue