Results 1 to 7 of 7

Thread: use third part makefile in QtCreator

  1. #1
    Join Date
    Jul 2012
    Posts
    40
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default use third part makefile in QtCreator

    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
    Pursue your targets and don't give up....

  2. #2
    Join Date
    Oct 2009
    Posts
    483
    Thanked 97 Times in 94 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: use third part makefile in QtCreator

    What does this Makefile do? Does it build the library? Does it install it?

  3. #3
    Join Date
    Jul 2012
    Posts
    40
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: use third part makefile in QtCreator

    it is the makefile to use hypertable:

    Qt Code:
    1. CC=g++
    2. CFLAGS=-c -Wall -D_REENTRANT -I/opt/hypertable/current/include \
    3. -I/opt/hypertable/current/include/thrift
    4. LDFLAGS=-rdynamic -L/opt/hypertable/current/lib -lHyperThrift \
    5. -lHyperCommon -lHypertable -lthrift -levent -llog4cpp
    6.  
    7. all: client_test
    8.  
    9. client_test: client_test.o
    10. $(CC) client_test.o $(LDFLAGS) -o client_test
    11.  
    12. client_test.o: client_test.cc
    13. $(CC) $(CFLAGS) client_test.cc
    14.  
    15. clean:
    16. rm -rf *o client_test
    To copy to clipboard, switch view to plain text mode 
    Pursue your targets and don't give up....

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: use third part makefile in QtCreator

    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.

  5. The following 2 users say thank you to ChrisW67 for this useful post:

    Qiieha (20th August 2015), Qtonimo (16th August 2012)

  6. #5
    Join Date
    Jul 2012
    Posts
    40
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: use third part makefile in QtCreator

    thanks

    I tried it already, but there is a problem:
    Qt Code:
    1. QT += core
    2.  
    3. QT -= gui
    4.  
    5.  
    6. INCLUDEPATH += /opt/hypertable/current/include \
    7. /opt/hypertable/current/include/thrift
    8.  
    9. LIBS += -L/opt/hypertable/current/lib
    10. LIBS += -lHyperThrift -lHyperCommon -lHypertable -lthrift -levent -llog4cpp
    11.  
    12. TARGET = hypertable_test
    13. CONFIG += console
    14. CONFIG -= app_bundle
    15.  
    16. TEMPLATE = app
    17.  
    18.  
    19. SOURCES += main.cpp
    To copy to clipboard, switch view to plain text mode 

    The compiler errors:
    /usr/bin/ld: cannot find -lthrift
    /usr/bin/ld: cannot find -levent
    /usr/bin/ld: cannot find -llog4cpp
    Pursue your targets and don't give up....

  7. #6
    Join Date
    Oct 2009
    Posts
    483
    Thanked 97 Times in 94 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: use third part makefile in QtCreator

    Have you properly compiled and installed the thrift, event, and log4cpp libraries? Do you even need them?

  8. #7
    Join Date
    Jul 2012
    Posts
    40
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: use third part makefile in QtCreator

    I think so... I just want to query the hypertable....


    Added after 1 19 minutes:


    Quote Originally Posted by yeye_olive View Post
    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....
    Last edited by Qtonimo; 16th August 2012 at 12:09.
    Pursue your targets and don't give up....

Similar Threads

  1. Replies: 2
    Last Post: 23rd August 2011, 12:23
  2. Replies: 1
    Last Post: 24th June 2011, 12:44
  3. Replies: 1
    Last Post: 31st March 2011, 18:38
  4. Replies: 0
    Last Post: 12th October 2010, 04:14
  5. QtCreator 2.0 crashes application working in QtCreator 1.3
    By been_1990 in forum Qt Programming
    Replies: 2
    Last Post: 21st September 2010, 12:58

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.