0

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

4

1 回答 1

0

您没有说您使用的是哪个发行版,但最简单的方法是安装 jasper 包并将您的应用程序链接到它的库。

顺便问一下,您是构建静态库(.a)还是动态库( .so)?尝试构建动态库

于 2011-06-07T19:41:20.777 回答