PDA

View Full Version : how to use a project as a library in another project



sliverTwist
15th April 2013, 16:11
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

alizadeh91
15th April 2013, 17:15
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/library/html/qt4/sharedlibrary.html

sliverTwist
16th April 2013, 16:23
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"

Santosh Reddy
16th April 2013, 16:33
Two things are required in pro file.

1. Include path of header files


INCLUDEPATH += mylib/src/inc



2. Library binary file path


LIBS += mylib/bin/lib.so

sliverTwist
16th April 2013, 16:40
apparently the problem was fixed by doing this #include <ocsync/csync.h> sorry for disturbing you and thanks a lot