Re: Using external libraries
Hi,
Use INCLUDEPATH to define the location of your header files, LIBPATH to define the location of your libraries, and LIBS to define the libs. For example
INCLUDEPATH += c:\qwt\include
LIBPATH += c:\qwt\lib
LIBS += -lqwt5
Hope this helps.
Re: Using external libraries
Thanks, but my libs are in the same folder as all my project files which is:
C:\Users\Pavel\Desktop\Pavel\Programs\Qt\myser2
I tried to add
Code:
INCLUDEPATH += C:\Users\Pavel\Desktop\Pavel\Programs\Qt\myser2
LIBPATH += C:\Users\Pavel\Desktop\Pavel\Programs\Qt\myser2
or
INCLUDEPATH += .
LIBPATH += .
but it doesn't work. I put my project on rapidshare (qtcentre has a 244k limit for zip files :(), maybe you could take a look:
http://rapidshare.com/files/410065957/myser2.zip
EDIT: Btw, when I include compiled libraries to my project, I do not need to also include all the header files that were used to compile that library, do I?
For instance, when I include qextserialport.h, does it look for it inside qextserialportd.dll or not?
Re: Using external libraries
Hi Handi,
I am getting the same error. i am wondering if you have overcome the problem. If so please let me know the solution.
Re: Using external libraries
Quote:
Originally Posted by
baluk
Hi Handi,
I am getting the same error. i am wondering if you have overcome the problem. If so please let me know the solution.
What error? The only thing mentioned above is that something "can't find any of those files" or "it doesn't work." An actual error message would be quite helpful, but I don't see any. At a minimum, it would illuminate whether the problem is an inability to locate the header files or the library files.
Re: Using external libraries
To quote and repair an earlier answer in this thread.
At compile time:
- Use INCLUDEPATH to define extra locations to be searched for header files
- Use LIBS -L options to define extra locations to be searched for libraries
- Use LIBS -l options to name the libs to be used.
Example:
Code:
INCLUDEPATH += /home/me/foo/include
LIBS += -L/home/me/foo/lib -lfoo
At run time the dynamically loadable libraries must be locatable by the operating system:
- On Windows: In the current working directory of the executing process (note that this is rarely the same as the source code directory) or on the system PATH.
- On Linux: In directories listed in the LD_LIBRARY_PATH environment variable (if it exists) and on the system library path (see /etc/ld.so.conf). See man ld.so for other, less used options.
- On Mac OS X: Probably similar to Linux but bound to be different in detail.