I get this error from compiling a program using lib555. I seems that I am missing something in the Makefile:
testrtsp.o: In function `main':
testrtsp.cpp:(.text+0x470): undefined reference to BasicTaskScheduler::createNew(unsigned int)'
testrtsp.cpp:(.text+0x480): undefined reference to `BasicUsageEnvironment::createNew(TaskScheduler&)'
testrtsp.cpp:(.text+0x49c): undefined reference to `Port::Port(unsigned short)'
testrtsp.cpp:(.text+0x4b0): undefined reference to `RTSPServer::createNew(UsageEnvironment&, Port, UserAuthenticat
ionDatabase*, unsigned int)'
collect2: error: ld returned 1 exit status
Makefile:64: recipe for target 'testrtsp' failed
My Makefile looks like this:
# generated from pkg-config --cflags gstreamer-0.10
CFLAGS=-pthread -I/usr/include/gstreamer-0.10 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libxml2
LIVE_INCLUDES=-I/home/root/live/UsageEnvironment/include -I/home/root/live/groupsock/include -I/home/root/live/liveMedia/include -I/home/root/live/BasicUsageEnvironment/include
LIVE_LIBS=/home/root/live/liveMedia/libliveMedia.a /home/root/live/groupsock/libgroupsock.a /home/root/live/BasicUsageEnvironment/libBasicUsageEnvironment.a /home/root/live/UsageEnvironment/libUsageEnvironment.a
LIVE_LIBS+=-lpthread
CXXFLAGS=$(CFLAGS)
# generated from pkg-config --libs gstreamer-0.10
LDFLAGS=-lgstreamer-0.10 -lgobject-2.0 -lgmodule-2.0 -pthread -lgthread-2.0 -pthread -lglib-2.0 -lxml2 -lgstapp-0.10
CFLAGS+=-I/usr/include/opencv2
CFLAGS+=-I/home/root/live/liveMedia/include
CFLAGS+=-I/home/root/live/groupsock/include
CFLAGS+=-I/home/root/live/UsageEnvironment/include
CFLAGS+=-I/usr/include/gtk-2.0
CFLAGS+=-I/usr/include/cairo
CFLAGS+=-I/usr/inlcude/pango-1.0
CFLAGS+=-I/usr/lib/gtk-2.0/include
CFLAGS+=-I/usr/include/gdk-pixbuf-2.0
CFLAGS+=-I/usr/include/atk-1.0
CFLAGS+=-I/usr/include/rtsp-server
CFLAGS+=-I/home/root/live/BasicUsageEnvironment/include/
CFLAGS+=-I/usr/include/
LDFLAGS+=-lstdc++ -lopencv_core -lopencv_features2d -lopencv_gpu -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_nonfree -lopencv_video
all: testrtsp
testrtsp: testrtsp.o
gcc -L. $(LDFLAGS) -o $@ $(LIVE_LIBS) $<
testrtsp.o: testrtsp.cpp
gcc -c $(CFLAGS) $(LIVE_INCLUDES) -o $@ $<
I included all needed live555 Headers in my program.
Edit: the cut off on right should be fixed
The solution was pretty easy. I changed this:
testrtsp:testrtsp.o
gcc -L. $(LDFLAGS) -o $@ $(LIVE_LIBS) $<
to this:
testrtsp: testrtsp.o
gcc -L. $(LDFLAGS) -o $@ $< $(LIVE_LIBS)