ich möchte mir ein kleines Programm für die DBox schreiben. Habe mal vor einiger Zeit damit angefangen,
und möchte nun weitermachen. Aber leider kenne ich mich nicht so gut mit dem gcc und dem linker aus.
Ich will ein eigenständiges Programm schreiben und dazu muß ich auf die zapit zugreifen.
Das include-file "zapitclient.h" wird zwar vom gcc gefunden, aber dann meckert der Linker:
Code: Alles auswählen
main.o(.text+0xe8): In function `main':
: undefined reference to `CBasicClient::CBasicClient()'
main.o(.text+0xee): In function `main':
: undefined reference to `vtable for CZapitClient'
main.o(.text+0xf2): In function `main':
: undefined reference to `vtable for CZapitClient'
collect2: ld returned 1 exit status
make: *** [server] Fehler 1
Wie bringe ich dem Linker, das er diese lib einbinden soll ?:gruebel:
Hier mein Makefile:
Code: Alles auswählen
###########################################################
### Makefile
###########################################################
CVSHOME = $(HOME)/tuxbox/tuxbox-cvs
CDKHOME = $(HOME)/tuxbox/dbox2
#CROSSCOMPILE=
#LDFLAGS = -L/lib
#CFLAGS = -Wall -O2 -D_REENTRANT
#INC = -I../IXModel
CROSSCOMPILE = $(CDKHOME)/cdk/bin/powerpc-tuxbox-linux-gnu-
LDFLAGS = -L$(CDKHOME)/cdk/lib -L$(CDKHOME)/cdkroot/lib
CFLAGS = -Wall -O2 -D_REENTRANT
INC = -I../IXModel -I$(CVSHOME)/driver/dvb/include -I$(CVSHOME)/driver/include -I$(CDKHOME)/cdkroot/include -I$(CDKHOME)/cdkroot/include/tuxbox
CC = $(CROSSCOMPILE)g++
LD = $(CROSSCOMPILE)g++
TARGET = server
all: $(TARGET)
STDHEADERS = ../IXModel/IXInclude.h\
./source/StdInc.h
IXOBJECTS = CXSocket.o CXFile.o CXTextFile.o \
CXCachedTextFile.o CXStringList.o CXDESCryptEngine.o CXTcpIpNetClient.o \
CXTcpIpNetServer.o
OBJECTS = main.o \
CXTuxUdpStreamReceiver.o CXTuxUdpSuperPacket.o CXTuxDVBDemuxer.o \
CXTuxDVBStreamWriter.o \
$(IXOBJECTS)
$(TARGET): $(OBJECTS)
$(LD) $(LDFLAGS) -o $(TARGET) $(OBJECTS) -lpthread
.c.o:
$(CC) $(CFLAGS) $(INC) -c $<
.cpp.o:
$(CC) -xc++ $(CFLAGS) $(INC) -c $<
main.o: ./source/main.c $(STDHEADERS)
$(CC) $(INC) $(CFLAGS) -c ./source/main.c
CXTuxUdpStreamReceiver.o: ./source/CXTuxUdpStreamReceiver.cpp $(STDHEADERS)
$(CC) $(INC) $(CFLAGS) -c ./source/CXTuxUdpStreamReceiver.cpp
CXTuxUdpSuperPacket.o: ./source/CXTuxUdpSuperPacket.cpp $(STDHEADERS)
$(CC) $(INC) $(CFLAGS) -c ./source/CXTuxUdpSuperPacket.cpp
CXTuxDVBStreamWriter.o: ./source/CXTuxDVBStreamWriter.cpp $(STDHEADERS)
$(CC) $(INC) $(CFLAGS) -c ./source/CXTuxDVBStreamWriter.cpp
CXTuxDVBDemuxer.o: ./source/CXTuxDVBDemuxer.cpp $(STDHEADERS)
$(CC) $(INC) $(CFLAGS) -c ./source/CXTuxDVBDemuxer.cpp
CXSocket.o: ../IXModel/Linux/src/CXSocket.cpp $(STDHEADERS)
$(CC) $(CFLAGS) -c $(INC) ../IXModel/Linux/src/CXSocket.cpp
CXFile.o: ../IXModel/Linux/src/CXFile.cpp $(STDHEADERS)
$(CC) $(CFLAGS) -c $(INC) ../IXModel/Linux/src/CXFile.cpp
CXTextFile.o: ../IXModel/Linux/src/CXTextFile.cpp $(STDHEADERS)
$(CC) $(CFLAGS) -c $(INC) ../IXModel/Linux/src/CXTextFile.cpp
CXCachedTextFile.o: ../IXModel/Linux/src/CXCachedTextFile.cpp $(STDHEADERS)
$(CC) $(CFLAGS) -c $(INC) ../IXModel/Linux/src/CXCachedTextFile.cpp
CXStringList.o: ../IXModel/Linux/src/CXStringList.cpp $(STDHEADERS)
$(CC) $(CFLAGS) -c $(INC) ../IXModel/Linux/src/CXStringList.cpp
CXDESCryptEngine.o: ../IXModel/Linux/src/CXDESCryptEngine.cpp $(STDHEADERS)
$(CC) $(CFLAGS) -c $(INC) ../IXModel/Linux/src/CXDESCryptEngine.cpp
CXTcpIpNetClient.o: ../IXModel/Linux/src/CXTcpIpNetClient.cpp $(STDHEADERS)
$(CC) $(CFLAGS) -c $(INC) ../IXModel/Linux/src/CXTcpIpNetClient.cpp
CXTcpIpNetServer.o: ../IXModel/Linux/src/CXTcpIpNetServer.cpp $(STDHEADERS)
$(CC) $(CFLAGS) -c $(INC) ../IXModel/Linux/src/CXTcpIpNetServer.cpp
clean:
find . -name "*.o" -exec rm \{} \;
find . -name "*.bak" -exec rm \{} \;
Code: Alles auswählen
///////////////////////////////////////////////////////////////////////////
// main.c
////////////////////////////////////////////////////////////////////////////
/* --- includes -------------------------------------------------------------*/
#include "StdInc.h"
#include <IXInclude.h>
#include <zapit/client/zapitclient.h>
/////////////////////////////////////////////////////////////////////////////
// main
/////////////////////////////////////////////////////////////////////////////
int main ( int argc, char *argv[] )
{
CZapitClient* g_Zapit = new CZapitClient;
sleep(5000);
return 0;
}
Wie gesagt, kenne mich nicht so doll mit linux aus! (Bin verwöhnt von der Windows-Welt! )
ciao Mr2You