Ask Your Question
0 error adding symbols: DSO missing from command line

asked 2015-08-30 07:29:01 -0500

Navalona gravatar image

Hello. I am inexperienced user in linking fortran shared library. I got the following error when compiling a program, any idea what's going wrong ? Thanks for your help.

g++ -g -Wl,--no-as-needed NuXSecData.o NuXSecFunc.o NuXSecComparison.o gVldNuXSec.o -L/home/navds/LocInstall/HEP/GENIE/lib -lGAlgorithm -lGBaryonResonance -lGBase -lGBodekYang -lGCharm -lGCoh -lGDfrc -lGDIS -lGCrossSections -lGDecay -lGElas -lGElFF -lGHEP -lGEVGCore -lGEVGModules -lGEVGDrivers -lGGiBUU -lGHadronTransp -lGFragmentation -lGInteraction -lGLlewellynSmith -lGMEC -lGMessenger -lGNuGamma -lGNuE -lGNtuple -lGNuclear -lGNumerical -lGQPM -lGPDG -lGPDF -lGQEL -lGRES -lGRegistry -lGReinSeghal -lGUtils -lGGeo -lGFluxDrivers -lGVLE -lGVHE -lGMuELoss -lGReWeight -lGNucleonDecay  -L/home/navds/LocInstall/HEP/ROOT/lib/root -lGui -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -pthread -lm -ldl -rdynamic -lMinuit -lGeom -lEG -lEGPythia6 -L/home/navds/LocInstall/HEP/PYTHIA6/pythia6428 -lPythia6 /home/navds/LocInstall/HEP/PYTHIA6/pythia6428/pythia6428.o /home/navds/LocInstall/HEP/PYTHIA6/pythia6428/pythia6_common_address.o  -L/usr/lib64 -lLHAPDF  -L/usr/lib64 -lxml2 -L/usr/local/lib -llog4cpp  -lnsl  -o /home/navds/LocInstall/HEP/GENIE/bin/gvld_nu_xsec
/bin/ld: /home/navds/LocInstall/HEP/PYTHIA6/pythia6428/pythia6428.o: undefined reference to symbol '_gfortran_transfer_real_write@@GFORTRAN_1.4'
/usr/lib64/ error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

My gcc (g++ and gfortran) version: 5.1.1

[navds@F22G580 root] $ locate libgfortran
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-08-31 06:14:00 -0500

marcindulak gravatar image

updated 2015-08-31 09:11:06 -0500

Check which versions of symbols are available for your gfortran:

strings /usr/lib64/ | grep "GFORTRAN_1"

and verify which version of g++/gfortran you are actually using:

g++ --version
gfortran --version
rpm -qf /usr/lib64/

If there is a mismatch, you will probably need to recompile /home/navds/LocInstall/HEP/PYTHIA6/pythia6428/ with gfortran-5.1.1. Otherwise try to add -lgfortran to the link line.

edit flag offensive delete link more


[navds@F22G580 ~] $ strings /usr/lib64/ |grep "GFORTRAN_1" GFORTRAN_1.0 GFORTRAN_1.1 GFORTRAN_1.2 GFORTRAN_1.3 GFORTRAN_1.4 GFORTRAN_1.5 GFORTRAN_1.6

Navalona gravatar imageNavalona ( 2015-08-31 06:30:49 -0500 )edit

[navds@F22G580 ~] $ g++ --version g++ (GCC) 5.1.1 20150618 (Red Hat 5.1.1-4)

   [navds@F22G580 ~] $ gfortran --version
   GNU Fortran (GCC) 5.1.1 20150618 (Red Hat 5.1.1-4)

[navds@F22G580 ~] $ rpm -qf /usr/lib64/
Navalona gravatar imageNavalona ( 2015-08-31 06:32:44 -0500 )edit

what happens if you add -lgfortran to the g++ ... link line? Just copy the whole line into the terminal, add -lgfortran at the end, and execute such modified line.

marcindulak gravatar imagemarcindulak ( 2015-08-31 06:36:03 -0500 )edit

this solved the problem! Thank you

Navalona gravatar imageNavalona ( 2015-08-31 12:51:44 -0500 )edit

Question Tools

1 follower


Asked: 2015-08-30 07:29:01 -0500

Seen: 3,996 times

Last updated: Aug 31 '15