Compiling fails due to libraries incompatibility (ROOT 5.18)

Hello ROOT experts,

I am having a problem while compiling my Class with ROOT 5.18.00 – about ROOT libraries not being compatible. In the Makefile, there are:

ROOTCFLAGS = $(shell $(ROOTSYS)/bin/root-config --cflags)
ROOTLIBS   = $(shell $(ROOTSYS)/bin/root-config --libs)
ROOTGLIBS  = $(shell $(ROOTSYS)/bin/root-config --glibs)

CFLAGS        = -O -Wall -fPIC -I$(ROOTSYS)/include
LD            = g++
LDFLAGS       = -O
SOFLAGS       = -shared
CXXFLAGS     +=  -I. -I$(ROOTSYS)/include

all: 		$(PROGRAM)

$(PROGRAM):     $(OBJS) 
		$(LD) $(LDFLAGS) $(CFLAGS) $(ROOTLIBS) $^ -o $(MAIN).exe
		@echo "Done"

But when I run make I get the following error :

g++ -I. -I/afs/cern.ch/sw/lcg/external/root/5.18.00/slc4_ia32_gcc34/root/include   -c -o main.o main.C
g++ -I. -I/afs/cern.ch/sw/lcg/external/root/5.18.00/slc4_ia32_gcc34/root/include   -c -o Analysis.o Analysis.C
g++ -O -O -Wall -fPIC -I/afs/cern.ch/sw/lcg/external/root/5.18.00/slc4_ia32_gcc34/root/include -L/afs/cern.ch/sw/lcg/external/root/5.18.00/slc4_ia32_gcc34/root/lib -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -pthread -lm -ldl -rdynamic  main.o Analysis.o -o main.exe
/usr/bin/ld: skipping incompatible /afs/cern.ch/sw/lcg/external/root/5.18.00/slc4_ia32_gcc34/root/lib/libCore.so when searching for -lCore
/usr/bin/ld: cannot find -lCore
collect2: ld returned 1 exit status

Does anyone have an idea why this library is incompatible , although it looks in the right place.

thanks a lot
Georgia

You are probably mixing 32bit and 64bit libraries. If you compile your application as a 64bit one, all libraries must be also 64bit. And vice versa…

Ok, I see. Could you please suggest me a proper option then, during compiling/linking ? I am not really familiar with this kind of issues.Thank you very much
Georgia

[quote=“georgia”]Ok, I see. Could you please suggest me a proper option then, during compiling/linking ? I am not really familiar with this kind of issues.Thank you very much
Georgia[/quote]
If you prefer 64bit environment, try to link against ROOT version from slc4_amd64_gcc34 (change your $ROOTSYS accordingly ).