Home | News | Documentation | Download

Makefile linkers


#1

ROOT Version: 6.16/00
Platform: MacOs
Compiler: Not Provided


Hi,
i have a problem compiling my project including root libraries.
This is my makefile:

main.x: main.o lib1.o lib2.o
	g++ -o main.x main.o lib1.o lib2.o `root-config --cflags` `root-config --glibs`
main.o: main.C lib.h
	g++ -c main.C `root-config --cflags` `root-config --glibs`
lib2.o: lib2.C lib.h
	g++ -c lib2.C
lib1.o: lib1.C lib.h
	g++ -c lib1.C

When I compile i see a list of error like these:
clang: warning: -lCore: ‘linker’ input unused [-Wunused-command-line-argument]
clang: warning: -lImt: ‘linker’ input unused [-Wunused-command-line-argument]
clang: warning: -lRIO: ‘linker’ input unused [-Wunused-command-line-argument]
The projects works but I don’t understand why I see these warnings.


#2

Can you please provide the output of running make?


#3

This is the output:

g++ -c main.C `root-config --cflags` `root-config --glibs`
clang: warning: -lGui: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -lCore: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -lImt: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -lRIO: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -lNet: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -lHist: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -lGraf: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -lGraf3d: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -lGpad: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -lROOTVecOps: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -lTree: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -lTreePlayer: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -lRint: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -lPostscript: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -lMatrix: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -lPhysics: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -lMathCore: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -lThread: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -lMultiProc: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -lROOTDataFrame: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -lpthread: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -lm: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -ldl: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-L/usr/local/Cellar/root/6.16.00/lib/root' [-Wunused-command-line-argument]
g++ -c lib1.C
g++ -c lib2.C
g++ -o main.x main.o lib1.o lib2.o `root-config --cflags` `root-config --glibs`

#4

Try with (first “rm -f main.x main.o lib1.o lib2.o”):

main.x: main.o lib1.o lib2.o
	`root-config --cxx --cflags` -o main.x main.o lib1.o lib2.o `root-config --glibs`
main.o: main.C lib.h
	`root-config --cxx --cflags` -c main.C
lib2.o: lib2.C lib.h
	`root-config --cxx --cflags` -c lib2.C
lib1.o: lib1.C lib.h
	`root-config --cxx --cflags` -c lib1.C