File is not of required architecture

Hello All,

I am trying to build some root libraries on my mac and am having some problems.

I do something like this

/usr/bin/g++ -c -O -Wall -fPIC -D_REENTRANT -pthread -m64 -I/usr/local/bin/root/root_v5.18.00/include -arch x86_64 -o CutTableBuilder.o /usr/bin/g++ -c -O -Wall -fPIC -D_REENTRANT -pthread -m64 -I/usr/local/bin/root/root_v5.18.00/include -arch x86_64 -o EnsembleProducer.o

followed by

rootcint -f -c -p -I/usr/local/bin/root/root_v5.18.00/include CutTableBuilder.h EnsembleProducer.h /usr/bin/g++ -c -O -Wall -fPIC -D_REENTRANT -pthread -m64 -I/usr/local/bin/root/root_v5.18.00/include -arch x86_64 -o mydict.o

which all goes without a complaint. Then when I try to make a dynamic library with

I get the following:

ld: warning in CutTableBuilder.o, file is not of required architecture ld: warning in EnsembleProducer.o, file is not of required architecture ld: warning in mydict.o, file is not of required architecture

I have tried this without the -arch flag. I am running on a Intel64 Macbook running Leopard ( OSX 10.5.4 ) and root version v5.18.00

Thanks for the help!!


Shouldn’t you be using/usr/bin/g++ -arch x86_64 -dynamiclib -install_name libEvent.dylib -o libEvent.dylib CutTableBuilder.o EnsembleProducer.o mydict.o ?



I had tried that and I get
Undefined symbols:
with every function in all the files listed.

Any idea why that would happen?


I am not sure. However in Leopard, dylib are no longer needed (if you still need it, you may have to check carefully the g++ option available). ROOT itself uses the following switches to build the library:

g++ -g -dynamiclib -single_module -undefined dynamic_lookup -install_name @rpath/ -m64 -o lib/ io/xmlparser/src/TDOMParser.o ... -ldl -L/usr/lib -lxml2 -lz -lpthread -licucore -lm


Great amazing wonderful!! It works!!

Thanks for the help!