Re: [ROOT] Unable to link libraries to gui

From: Jiri Masik (Jiri.Masik@cern.ch)
Date: Mon Aug 20 2001 - 09:49:22 MEST


"cstrato@EUnet.at" <cstrato@EUnet.at> writes:

> Dear Rooters
> 
> Now that my GUI works I would like to compile it as standalone
> program and to link it to my two libraries, libMyClassA and
> libMyClassB (where libMyClassB is needed by libMyClassA only).
> 
> Here is the output of compiling and linking:
> [christian@pbook xps]$ gmake -f Makefile4Mygui
> g++ -O -Wall -fPIC -fsigned-char -I/usr/X11/include
> -I/home/christian/rt/root/include -c Mygui.cxx
> Generating dictionary MyguiDict.cxx...c
> Class TMyFrame: Streamer() not declared
> Class TMyFrame: ShowMembers() not declared
> ...etc...
> g++ -O -Wall -fPIC -fsigned-char -I/usr/X11/include
> -I/home/christian/rt/root/include -c MyguiDict.cxx
> g++ -O -o Mygui Mygui.o MyguiDict.o -L. -lMyClassB -lMyClassA
> -L/home/christian/rt/root/lib -lCore -lCint -lHist -lGraf -lGraf3d
> -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lGui -lm -ldl
> -rdynamic
> Mygui.o: In function `TMyFrame::FRun(void)':
> Mygui.o(.text+0x4948): undefined reference to `TMyClassB::TMyClassB(char
> const *)'
> ...etc...
> collect2: ld returned 1 exit status
> gmake: *** [Mygui] Error 1
> 

Hi Christian,

if you are sure this constructor is implemented try to add the library
which contains it once more on the command line 
g++ -O Mygui.o MyguiDict.o -L. -lMyClassB -lMyClassA -lMyClassB
or swap -lMyClassA and -lMyClassB.
GNU ld searches for undefined symbols in the rest of the archives not
going to the first archive in the list again.
cheers
-- 
	Jiri



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:58 MET