View Full Version : use third part makefile in QtCreator
Qtonimo
16th August 2012, 10:42
Hello I want to use a third party library in my Qt Project. I use QtCreator...
The Doc of the third party lib provide a Makefile, but I don't know how I can link my QT Project against the third party Makefile.
Maybe someone can help me...
thanks :)
yeye_olive
16th August 2012, 11:26
What does this Makefile do? Does it build the library? Does it install it?
Qtonimo
16th August 2012, 11:28
it is the makefile to use hypertable:
CC=g++
CFLAGS=-c -Wall -D_REENTRANT -I/opt/hypertable/current/include \
-I/opt/hypertable/current/include/thrift
LDFLAGS=-rdynamic -L/opt/hypertable/current/lib -lHyperThrift \
-lHyperCommon -lHypertable -lthrift -levent -llog4cpp
all: client_test
client_test: client_test.o
$(CC) client_test.o $(LDFLAGS) -o client_test
client_test.o: client_test.cc
$(CC) $(CFLAGS) client_test.cc
clean:
rm -rf *o client_test
ChrisW67
16th August 2012, 11:34
You don't use the Makefile.
Put the relevant -L and -l options from the LDFLAGS variable in your PRO file LIBS variable. The paths from the CFLAGS -I options go in the INCLUDEPATH in the PRO file.
Qtonimo
16th August 2012, 11:38
thanks ;)
I tried it already, but there is a problem:
QT += core
QT -= gui
INCLUDEPATH += /opt/hypertable/current/include \
/opt/hypertable/current/include/thrift
LIBS += -L/opt/hypertable/current/lib
LIBS += -lHyperThrift -lHyperCommon -lHypertable -lthrift -levent -llog4cpp
TARGET = hypertable_test
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
The compiler errors:
/usr/bin/ld: cannot find -lthrift
/usr/bin/ld: cannot find -levent
/usr/bin/ld: cannot find -llog4cpp
yeye_olive
16th August 2012, 11:47
Have you properly compiled and installed the thrift, event, and log4cpp libraries? Do you even need them?
Qtonimo
16th August 2012, 13:09
I think so... I just want to query the hypertable....
Added after 1 19 minutes:
Have you properly compiled and installed the thrift, event, and log4cpp libraries? Do you even need them?
You were right...After installing apache thrift, the test works.
Thank you for your help guys....
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.