标题:关于Qt和其他库的编译问题
作者:zhaonash
日期:2006-04-20 20:56
内容:
在Qt中调用其他的库 该怎样编译呢?
#1 [XChinux 04-20 21:19]
你要调用什么库?它是以什么形式提供的
#2 [billdates 04-20 22:23]
In your .pri file or your .pro file, use "LIBPATH += "
and in the same file, use "LIBS += "
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.
#3 [zhaonash 04-22 14:48]
intel 的ipp 刚开始学不知道能不能和Qt一起编译