[ROOT] Unable to link libraries to gui

From: cstrato@EUnet.at
Date: Sun Aug 19 2001 - 19:39:13 MEST


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

Sorrowly, the linker does not find the reference to MyClassB.
The following command line does also not work:
g++ -O 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  -o Mygui

Can someone give me a hint what might be the reason?

Do I need to create a make file which compiles the
libraries together with the GUI program?

Thank you in advance

Best regards
Christian
----------------------------------
C.h.r.i.s.t.i.a.n  S.t.r.a.t.o.w.a
V.i.e.n.n.a,  A.u.s.t.r.i.a



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