Problem with linking with Root libraries on macosx

Hi,

We have installed Root v5.26/00 from source on macosx platform (see below more details) and when linking a user program with Root libraries we are getting the following errors. Would you have any idea what gets wrong here?

Thank you,

Ivana

Mac_Roller > make

g++ -c -I/cern/root/include -L/Users/jass/Tandem-18-11-2009/programs/RootObjects lecturebin.cpp
g++ -o lecturebin -L/usr/local/lib/root -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lfreetype -lGui -pthread -lm -ldl -L/Users/jass/Tandem-18-11-2009/programs/RootObjects -lCalo18Event lecturebin.o
ld: warning: in /usr/local/lib/root/libCore.so, file is not of required architecture
ld: warning: in /usr/local/lib/root/libCint.so, file is not of required architecture
ld: warning: in /usr/local/lib/root/libRIO.so, file is not of required architecture
ld: warning: in /usr/local/lib/root/libNet.so, file is not of required architecture
ld: warning: in /usr/local/lib/root/libHist.so, file is not of required architecture
ld: warning: in /usr/local/lib/root/libGraf.so, file is not of required architecture
ld: warning: in /usr/local/lib/root/libGraf3d.so, file is not of required architecture
ld: warning: in /usr/local/lib/root/libGpad.so, file is not of required architecture
ld: warning: in /usr/local/lib/root/libTree.so, file is not of required architecture
ld: warning: in /usr/local/lib/root/libRint.so, file is not of required architecture
ld: warning: in /usr/local/lib/root/libPostscript.so, file is not of required architecture
ld: warning: in /usr/local/lib/root/libMatrix.so, file is not of required architecture
ld: warning: in /usr/local/lib/root/libPhysics.so, file is not of required architecture
ld: warning: in /usr/local/lib/root/libMathCore.so, file is not of required architecture
ld: warning: in /usr/local/lib/root/libThread.so, file is not of required architecture
ld: warning: in /usr/local/lib/root/libfreetype.a, file is not of required architecture
ld: warning: in /usr/local/lib/root/libGui.so, file is not of required architecture
Undefined symbols:
“TObject::operator delete(void*)”, referenced from:
_main in lecturebin.o
_main in lecturebin.o
_main in lecturebin.o
“TStorage::ObjectAlloc(unsigned long)”, referenced from:
TObject::operator new(unsigned long)in lecturebin.o
“TTree::TTree(char const*, char const*, int)”, referenced from:
_main in lecturebin.o
“TFile::TFile(char const*, char const*, char const*, int)”, referenced from:
_main in lecturebin.o
“TBuffer::GetClass(std::type_info const&)”, referenced from:
TBranch* TTree::Branch(char const*, char const*, Calo18Event**, int, int)in lecturebin.o
“TVersionCheck::TVersionCheck(int)”, referenced from:
__static_initialization_and_destruction_0(int, int)in lecturebin.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [lecturebin] Error 1

The root itself can be started without any problem.

The platform:
Mac_Roller > uname -a

Darwin Jass-MacBook.local 10.2.0 Darwin Kernel Version 10.2.0: Tue Nov 3 10:37:10 PST 2009; root:xnu-1486.2.11~1/RELEASE_I386 i386

The gcc:
Mac_Roller > g++ -v

Using built-in specs.
Target: i686-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5646.1~2/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/[1][^.-]*/s//-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5646) (dot 1)


  1. cg ↩︎

You did not post the most important info (how you did configure)!
It is likely that you selected the installation in 32 bits mode on a 64 bits platform.
If you run on 64 bits, do
./configure macosx64 …other options

Rene

Hi Rene,

The problem was indeed as you guessed: root was configured with macosx while the platform was 64 bits. We recompiled Root with macosx64 and the user program links and runs ok.

Thank you for your help,

Ivana