SLAC PEP-II
BABAR
SLAC<->RAL
Babar logo
HEPIC E,S & H Databases PDG HEP preprints
Organization Detector Computing Physics Documentation
Personnel Glossary Sitemap Search Hypernews
Unwrap page!
Comp. Search
Who's who?
Meetings
FAQ Homepage
Archive
Environment
Administration
New User Info.
Web Info/Tools
Monitoring
Training
Tools & Utils
Programming
C++ Standard
SRT, AFS, CVS
QA and QC
Remedy
Histogramming
Operations
PromptReco
Simulation Production
Online SW
Dataflow
Detector Control
Evt Processing
Run Control
Calibration
Databases
Offline
Workbook
Coding Standards
Simulation
Reconstruction
Prompt Reco.
BaBar Grid
Data Distribution
Beta & BetaTools
Kanga & Root
Analysis Tools
RooFit Toolkit
Data Management
Data Quality
Event display
Event Browser
Code releases
Databases
Check this page for HTML 4.01 Transitional compliance with the
W3C Validator
(More checks...)
Solving link errors when linking with -non_shared

BaBar code is not typically linked with -non_shared. Consequently, some link errors will occur, which you will need to address ad hoc. Hopefully we can find a better solution later.

If the problem was a multiply defined symbol:

Link again, with options which tell you where the symbol was defined:

>gmake  CXXFLAGS+=-non_shared  LDGFLAGS+=-Wl,-ysymbol1,-ysymbol2  BetaUser.bin

where symbol1, symbol2, etc., are the multiply defined symbols. Note the lack of spaces in these flags and follow them carefully. This will write to standard output all the libraries and object moduls therein in which the symbols were found. You need to remove all but one of the definitions of each symbol:

Let $lib be a library, and $obj be the object module in that library, in which the symbol was defined. Then

>ar -w $lib | grep $obj

will produce a list of all the symbols (function and global data) which are defined in $obj. If you're lucky, only in one of these libraries will $obj contain other symbols, in additional to the multiply defined symbol. You will now create a local version of all the other libraries, from which you will remove the offending object modules. From the release directory:

>cp $lib lib/$BFARCH
>ar -d $lib $obj

Now you are ready to try and link again.