The other problem I encounter is Makefile. In order to link, compile and generate the program file you need to learn to write a Makefile. For detailed step by step of learning Makefile, you can go to http://www.linuxdevcenter.com/pub/a/linux/2002/01/31/make_intro.html
The following is a Makefile Sample, you can modified for your program.
Makefile Sample:
Once stub.cfg and objectName.ocf have been set up, we can launch the compilation. I advise you to create a makefile for each object. The following code is an example of makefile that the programmer can easily modify to his own taste by changing ¡§mySampleClass¡¨ to his/her object¡¦s name:
OPENRSDK_ROOT?=/ usr /local /OPEN_R_SDK
INSTALLDIR=../MS
CXX=$ (OPENRSDK_ROOT) / bin / mipsel-linux-g++
STRIP=$ (OPENRSDK_ROOT) / bin / mipsel-linux-strip
MKBIN=$ (OPENRSDK_ROOT) /OPEN_R/ bin /mkbin
STUBGEN=$ (OPENRSDK_ROOT) /OPEN_R/ bin / stubgen2
MKBINFLAGS=-p $ (OPENRSDK_ROOT)
LIBS=-L$ (OPENRSDK_ROOT) /OPEN_R/ lib -lObjectComm -lOPENR
CXXFLAGS= \
-O2 \
-g \
-I. \
-I$ (OPENRSDK_ROOT)/OPEN_R/ include /R4000 \
-I $ (OPENRSDK_ROOT) /OPEN_R/ include \
#
#When OPENR_DEBUG is defined, OSYSDEBUG( ) is available.
#
#CXXFLAGS+= -DOPENR_DEBUG
.PHONY: all install clean
all: mySampleClass.bin
%.o: %. cc
$ (CXX) $ (CXXFLAGS) -o $@ -c $^
MySampleClassStub.cc : stub.cfg
$ (STUBGEN) stub.cfg
mySampleClass.bin : MySampleClassStub.o .o mySampleClass . ocf
$ (MKBIN) $ (MKBINFLAGS) -o $@ $^ $(LIBS)
$ (STRIP) $@
install : mySampleClass.bin
gzip.c mySampleClass.bin > $(INSTALLDIR)/OPEN-R/MW/OBJS/MYSMPLE.BIN
clean :
rm -f *.o *.bin *.elf *.snap .cc
rm -f MySampleClassStub.h MySampleClassStub.cc def.h entry.h
rm -f $(INSTALLDIR)/OPEN-R/MW/OBJS/MYSMPLE.BIN