我正在尝试将新库添加到 Qt 插件文件夹中。
该插件位于此处:
http://qt.gitorious.org/qt-solutions/qt -solutions/trees/master/qtjp2imageformat
它说它需要 jasper 来构建,所以我下载了 jasper,并构建了它,生成了一个libjasper.a 在我的 jasper/lib 文件夹中(位于我的主目录中,而不是在 /usr 或其他目录中)
所以我使用 jasper 包含文件构建了 qtjp2imageformat,并链接到该 libjasper.a 文件,
这里是来自makefile:
INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++-64 -I. -I/usr/lib64/qt4/include/QtCore -I/usr/lib64/qt4/include/QtGui -I/usr/lib64/qt4/include -I../src -I. -I/home/dcole/software/jasper-1.900.1/include
LIBS = $(SUBLIBS) -L/usr/lib64/qt4/lib64 -L/home/dcole/software/jasper-1.900.1/lib -ljasper -lQtGui -L/usr/lib64/mysql -L/usr/lib64/qt4/lib64 -L/usr/X11R6/lib64 -lQtCore -lpthread
然后我将生成的 libqtjp2.so 放入 QT Plugins/imageformats 文件夹中,现在当我的代码运行时,并到达它将读取的部分jpeg2000,我得到以下信息:符号查找错误:/usr/lib64/qt4/plugins/imageformats/libqtjp2.so:未定义符号:jas_init
所以我认为jas_init来自jasper - 为什么我的QT项目看不到那个?我是否还需要将我的项目链接到 libjasper.a,或者在构建 libqtjp2 时链接库错误?
谢谢
I am trying to add a new library to the Qt plugins folder.
That plugin is located here:
http://qt.gitorious.org/qt-solutions/qt-solutions/trees/master/qtjp2imageformat
It says that it requires jasper to build, so I downloaded jasper, and built it, generating a libjasper.a in my jasper/lib folder (which is in my home dir, not in /usr or anything)
So i built out qtjp2imageformat using the jasper include files, and linking against that libjasper.a file
here are the relevant lines from the makefile:
INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++-64 -I. -I/usr/lib64/qt4/include/QtCore -I/usr/lib64/qt4/include/QtGui -I/usr/lib64/qt4/include -I../src -I. -I/home/dcole/software/jasper-1.900.1/include
LIBS = $(SUBLIBS) -L/usr/lib64/qt4/lib64 -L/home/dcole/software/jasper-1.900.1/lib -ljasper -lQtGui -L/usr/lib64/mysql -L/usr/lib64/qt4/lib64 -L/usr/X11R6/lib64 -lQtCore -lpthread
I then put the generated libqtjp2.so in the QT Plugins/imageformats folder, and now when my code runs, and gets to the part where it's going to read a jpeg2000, I get the following: symbol lookup error: /usr/lib64/qt4/plugins/imageformats/libqtjp2.so: undefined symbol: jas_init
So I think jas_init comes from jasper - how come my QT project can't see that? Do I need to also make MY project link against libjasper.a, or have I linked the library wrong when I built libqtjp2?
Thanks
发布评论
评论(1)
您没有说明您正在使用哪个发行版,但最简单的方法是安装 jasper 包并将您的应用程序链接到它的库。
顺便问一下,您构建的是静态库(
.a
)还是动态库(.so
)?尝试构建动态库You didn't say which distro you are using, but the simplest would be to install the jasper package and link your application to it's library.
by the way, did you build static library (
.a
) or dynamic (.so
)? Try building a dynamic library