Results 1 to 5 of 5

Thread: how to use a project as a library in another project

  1. #1
    Join Date
    Feb 2013
    Location
    Banzart
    Posts
    54
    Thanks
    17
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default how to use a project as a library in another project

    Hello

    I have here the ocsync project that i have already compiled it on qt . I am asking about how can i use it as a library in my project .
    Generally the question is how to use a project as library in another project in Qt [my Qt is Qt Creator 2.5.0 Based on Qt 4.8.1 (64 bit)] and my Os is openSUSE
    cheers
    Sliver_Twist

  2. #2
    Join Date
    Jan 2012
    Location
    Iran, Tehran
    Posts
    308
    Thanks
    75
    Thanked 24 Times in 21 Posts
    Qt products
    Qt4 Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: how to use a project as a library in another project

    You have to create shared library with it. In QtCreator just Create a library and add you classes and dont forget about macros.
    see:
    http://harmattan-dev.nokia.com/docs/...edlibrary.html
    Last edited by alizadeh91; 15th April 2013 at 17:09.

  3. The following user says thank you to alizadeh91 for this useful post:

    sliverTwist (16th April 2013)

  4. #3
    Join Date
    Feb 2013
    Location
    Banzart
    Posts
    54
    Thanks
    17
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: how to use a project as a library in another project

    Hello again , well i added the .so file to my project that is located externally but when i try to include it it says that the file does not exists #include<csync.h> "no such file or directory"
    Sliver_Twist

  5. #4
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: how to use a project as a library in another project

    Two things are required in pro file.

    1. Include path of header files
    Qt Code:
    1. INCLUDEPATH += mylib/src/inc
    To copy to clipboard, switch view to plain text mode 


    2. Library binary file path
    Qt Code:
    1. LIBS += mylib/bin/lib.so
    To copy to clipboard, switch view to plain text mode 
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

  6. The following user says thank you to Santosh Reddy for this useful post:

    sliverTwist (16th April 2013)

  7. #5
    Join Date
    Feb 2013
    Location
    Banzart
    Posts
    54
    Thanks
    17
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: how to use a project as a library in another project

    apparently the problem was fixed by doing this #include <ocsync/csync.h> sorry for disturbing you and thanks a lot
    Sliver_Twist

Similar Threads

  1. Linking a .a and .dll library to Qt project
    By ehnuh in forum Qt Programming
    Replies: 7
    Last Post: 29th March 2013, 05:49
  2. Link a .dll library to a Qt project
    By n3500 in forum Qt Programming
    Replies: 2
    Last Post: 27th July 2012, 11:31
  3. Replies: 22
    Last Post: 1st February 2012, 21:56
  4. i want build My project use VLC library on QT
    By nhs_0702 in forum Qt Programming
    Replies: 1
    Last Post: 13th March 2010, 06:41
  5. How do to add a library to my project?
    By N3wb in forum Qt Programming
    Replies: 9
    Last Post: 2nd October 2009, 06:11

Tags for this Thread

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.