0

在我将使用这个库来编译可执行程序之后,我创建了一些库,最后我得到了一个致命错误

g++  -O2     -L/home/morad/workdir/library/tklibs/lib -L/home/morad/workdir/layout/lib   -L/usr/lib  -Xlinker -start-group  -Xlinker -lGeomPropagators -Xlinker -lPatternPrimitives -Xlinker -lSurfaceGeometry -Xlinker -lBaseMagneticField -Xlinker -lUI -Xlinker -lGenUtil -Xlinker -lSiPixelDet -Xlinker -lSmearingClusterizers -Xlinker -lBasicDet -Xlinker -lTrackFitters -Xlinker -lTkFastSimHit -Xlinker -lCommonStripDet -Xlinker -lDetLayout -Xlinker -lTkLayout -Xlinker -lDetGeometry -Xlinker -lKalmanUpdators -Xlinker -lTkCommonDet -Xlinker -lPatternTools -Xlinker -lTrajectoryParametrization -Xlinker -lxmlgeom -Xlinker -ltrack -Xlinker -lcross -Xlinker -lMaterialEffects -Xlinker -lPropagators -Xlinker -ltracking -Xlinker -lgeom -Xlinker -lStatUtilities -Xlinker -lAnalyticalJacobians -Xlinker -lxmltkgeom -Xlinker -lutils -Xlinker -lopt -Xlinker -ldraw -Xlinker -lanalyze -Xlinker -lDetVolumeGeometry -Xlinker -lPatternTestTools -Xlinker -lRKPropagators -Xlinker -lBasicStripDet -Xlinker -lDetUtilities -Xlinker -lTkNavigation -Xlinker -lNumericalJacobians -Xlinker -ltkhist -Xlinker -end-group  -lxml++-2.6 -lxml2 -lglibmm-2.4 -lgobject-2.0 -lsigc-2.0 -lglib-2.0  /usr/lib/preloadable_libintl.so -L/cern/ROOT/source/root/lib  /usr/lib/libX11.so -L/cern/Minuit2/5.28.00/lib -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lfreetype -lz  /usr/lib/libbz2.so.1.0.6 -pthread -Wl,-rpath,/cern/ROOT/source/root/lib -lm -ldl  -L/cern/CLHEP/2.0.4.5/lib/ -lCLHEP-2.0.4.5 -I/cern/CLHEP/2.0.4.5/include/  -I/home/morad/workdir/layout -I/home/morad/workdir/library/tklibs  -I/cern/ROOT/source/root/include  -I/usr/include/freetype2/freetype/  -I/usr/include/freetype2 -I/usr/include/libxml2 -I/usr/include/libxml++-2.6 -I/usr/lib/libxml++-2.6/include/ -I/usr/include/glibmm-2.4/ -I/usr/lib/glibmm-2.4/include/ -I/usr/include/sigc++-2.0/ -I/usr/lib/sigc++-2.0/include/ -I/usr/include/glib-2.0/ -I/usr/lib/glib-2.0/include/ -I/cern/gettext/0.18.2/include/ -I/cern/Minuit2/5.28.00/include myAnalyze.cc -o pol                                                                                                                                                                                               
/usr/lib/gcc/i586-suse-linux/4.7/../../../../i586-suse-linux/bin/ld: warning: libMinuit2.so.0, needed by /home/morad/workdir/layout/lib/libxmlgeom.so, not found (try using -rpath or -rpath-link)                                                                                                                                                                                              
/usr/lib/gcc/i586-suse-linux/4.7/../../../crt1.o: In function `_start':                                                                                                                         
/home/abuild/rpmbuild/BUILD/glibc-2.15/csu/../sysdeps/i386/elf/start.S:115: undefined reference to `main'                                                                                       
/home/morad/workdir/library/tklibs/lib/libSmearingClusterizers.so: undefined reference to `TrivialROUSetter::set(Module)'                                                                       
/home/morad/workdir/library/tklibs/lib/libTkLayout.so: undefined reference to `FixTIDTopology::recreateTopologies()'                                                                            
/home/morad/workdir/library/tklibs/lib/libSmearingClusterizers.so: undefined reference to `TkDetTypeName::shortName(DetType const&)'                                                            
/home/morad/workdir/library/tklibs/lib/libTkLayout.so: undefined reference to `DetUnitGluer::glue(__gnu_cxx::__normal_iterator<DetUnit**, std::vector<DetUnit*, std::allocator<DetUnit*> > >, __gnu_cxx::__normal_iterator<DetUnit**, std::vector<DetUnit*, std::allocator<DetUnit*> > >, __gnu_cxx::__normal_iterator<DetUnit**, std::vector<DetUnit*, std::allocator<DetUnit*> > >, __gnu_cxx::__normal_iterator<DetUnit**, std::vector<DetUnit*, std::allocator<DetUnit*> > >)'
/home/morad/workdir/library/tklibs/lib/libTkFastSimHit.so: undefined reference to `RawHepEventFactoryFromGun::RawHepEventFactoryFromGun()'
/home/morad/workdir/library/tklibs/lib/libTkLayout.so: undefined reference to `toa::operator()(int const&) const'
/home/morad/workdir/library/tklibs/lib/[u]libTkLayout.so: undefined reference to `FixTIDTopology::FixTIDTopology()'
/home/morad/workdir/library/tklibs/lib/libTkLayout.so: undefined reference to `DetBlade::DetBlade(__gnu_cxx::__normal_iterator<Det* const*, std::vector<Det*, std::allocator<Det*> > >, __gnu_cxx::__normal_iterator<Det* const*, std::vector<Det*, std::allocator<Det*> > >)'
/home/morad/workdir/library/tklibs/liblibTkLayout.so: undefined reference to `toa::~toa()'
/home/morad/workdir/library/tklibs/lib/libTkLayout.so: undefined reference to `FullTracker::instance()
collect2: erreur: ld a retourné 1 code d'état d'exécution

知识无法更改我的文件 *.cc 和 *.h 所以我的问题是:是否可以强制 gcc 编译这个文件 myfile.cc?

4

0 回答 0