In your .pri file or your .pro file, use "LIBPATH += <YOUR_LIB_PATH_SEPARATED_BY_SPACES>"
and in the same file, use "LIBS += <YOUR_LIB_NAME>"
e.g., you have a project named QTCN and in that project, you have 2 sub directories: QTCN/DIR1 and QTCN/DIR2. In DIR1 you want to include libMy.so (in /usr/local/lib) for Linux and My.dll (in C:/MyLib) for Win32. Do the following:
In project dir QTCN/, create a file mydef.pri with the following content:
win32{
LIBPATH += C:/MyLib
}
else{
#assume linux
LIBPATH += /usr/local/lib
}
in QTCN/DIR1/DIR1.pro
TOPLEVEL=..
include ($$TOPLEVEL/mydef.pri)
win32{
LIBS +=-lMy
}
else{
LIBS +=-lMy
}
Comments:
1. You don't have to use mydef.pri but it's a good practice.
2. You don't have to define LIBPATH this way. You can forget about the mydef.pri part and simply use things like "LIBS += -L/usr/local/lib -lMy" in your .pro file but if you have big projects, the example I gave should be a good thing to do.