Good morning to everyone.
First of all, I work in Linux Ubuntu 8.04 with Eclipse and Qt integration.
I'm making a qt gui project named "rezclient". In my project I have to use some c functions of a library (librezShared.a) and other c functions declared in "rezCltProtocol.h" and defined in "rezCltProtocol.c". I have no problem with the library, but I have the error "undefined reference to" the functions of the rezCltProtocol.h file.
- This is the message of console:
"make debug
make -f Makefile.Debug
make[1]: Entering directory `/home/francesco/Scrivania/SERVER/eclipseWorkspace/rezclient'
g++ -Wl,-rpath,/usr/local/Trolltech/Qt-4.4.3/lib -o rezclient debug/main.o debug/rezclient.o debug/moc_rezclient.o -L/usr/local/Trolltech/Qt-4.4.3/lib -lrezShared -L/home/francesco/Scrivania/SERVER/sharedSrc/Debug -lQtGui -L/usr/local/Trolltech/Qt-4.4.3/lib -L/usr/X11R6/lib -lXext -lX11 -lQtCore -lz -lm -lrt -ldl -lpthread
debug/rezclient.o: In function `rezclient:n_pushButton_clicked()':
make[1]: Leaving directory `/home/francesco/Scrivania/SERVER/eclipseWorkspace/rezclient'
/home/francesco/Scrivania/SERVER/eclipseWorkspace/rezclient/rezclient.cpp:34: undefined reference to `execCmdHeartbeat(int, unsigned int, double*)'
/home/francesco/Scrivania/SERVER/eclipseWorkspace/rezclient/rezclient.cpp:35: undefined reference to `execCmdGetClients(int, unsigned int, tRezClientList*)'
collect2: ld returned 1 exit status
make[1]: *** [rezclient] Error 1
make: *** [debug] Error 2"
- This is my .pro file:
TEMPLATE = app
TARGET = rezclient
QT += core \
gui
# Input
HEADERS += rezclient.h
SOURCES += main.cpp \
rezclient.cpp
FORMS += rezclient.ui
INCLUDEPATH += /home/francesco/Scrivania/SERVER/sharedSrc; \
/home/francesco/Scrivania/SERVER/rezClient/src;
LIBS += -lrezShared \
-L/home/francesco/Scrivania/SERVER/sharedSrc/Debug
And in my code I use this instructions to include the headers files:
extern "C"{
#include "../../sharedSrc/commondefs.h"
#include "../../sharedSrc/rezProtocol.h"
#include "../../sharedSrc/tcpsocket.h"
#include "../../rezClient/src/rezCltProtocol.h"
}
I really don't know how to solve this problem. I hope you'll help me.
Good morning.
Francesco.
Ps. Excuse me for my english.
Bookmarks