Makefile, generating dictionaries

Hello,
I have difficulties compiling and linking a simple ROOT program.
I wrote a main.cpp and MainFrame.h + MainFrame.cpp

Here’s the Makefile used :

[code]OBJS = MainFrame.o main.o
LIBS = root-config --glibs -lHtml -lSpectrum
CXXFLAGS = -O2 -g -Wall root-config --cflags -fmessage-length=0
TARGET = app
NET_LIB_F := -DNET_LIB
ROOTCFLAGS := $(shell root-config --cflags) -I$(ROOTSYS)/xmlparser/inc -I$(ROOTSYS)/io/xmlparser/inc

$(TARGET): $(OBJS)
$(CXX) -o $(TARGET) $(OBJS) $(LIBS)

GDict : main.h
@echo “Generating dictionary $@…”
@rootcint -v -f $@ -c -p -D__const=const -D__timezone_ptr_t=void $(NET_LIB_F) $(ROOTCFLAGS) ./main.h
@echo “$@ done”

all: GDict $(TARGET)

clean:
rm -f $(OBJS) $(TARGET)

[/code]

But I get undefined references errors.

MainFrame.o: In function `MainFrame::IsA() const': /home/eoutin/workspace/M1/MainFrame.h:26: undefined reference to `MainFrame::Class()' MainFrame.o:(.rodata._ZTV9MainFrame[vtable for MainFrame]+0xe8): undefined reference to `MainFrame::ShowMembers(TMemberInspector&)' MainFrame.o:(.rodata._ZTV9MainFrame[vtable for MainFrame]+0xec): undefined reference to `MainFrame::Streamer(TBuffer&)'

I know that I need to generate dictionaries, but no idea how does it work within the Makefile.

Thanks in advance for help,

eoutin

http://root.cern.ch/drupal/content/interacting-shared-libraries-rootcint
http://root.cern.ch/drupal/content/selecting-dictionary-entries-linkdefh
http://root.cern.ch/root/RootCintMan.html
[…]$ rootcint -h
[…]$ man rootcint
http://root.cern.ch/viewvc/trunk/cint/doc/makecint.txt
http://root.cern.ch/drupal/content/how-compile-and-link-root-libraries
http://root.cern.ch/download/doc/ROOTUsersGuideHTML/ch01s06.html#d5e612
http://root.cern.ch/download/doc/ROOTUsersGuideHTML/ch20s02.html
[…]$ ls ${ROOTSYS}/test

Ok thanks Pepe, i’ll have a look.
By the way, I’ve found a magic website from a CERN engineer.
http://gentitfx.fr/Skeleton/
He solves my problem perfectly, thanks François-Xavier Gentit.