[Qt-interest] Building JPEG2000 image plugin

Cole, Derek dcole at integrity-apps.com
Tue Jun 7 20:17:23 CEST 2011


I did notice that the qt jpeg 2000 plugin says it is only available as a shared lib. I configured with the -library option, so that should have been correct, right? Does this mean I also need to build jasper as a shared  library too? I noticed jasper has a --enable-shared option that defaults to "no."

Should I try to rebuild both as shared libs, and see if that does the trick?

Thanks


________________________________________
From: qt-interest-bounces+dcole=integrity-apps.com at qt.nokia.com [qt-interest-bounces+dcole=integrity-apps.com at qt.nokia.com] on behalf of Cole, Derek [dcole at integrity-apps.com]
Sent: Tuesday, June 07, 2011 1:41 PM
To: Thiago Macieira; qt-interest at qt.nokia.com
Subject: Re: [Qt-interest] Building JPEG2000 image plugin

Thanks for the reply.

I was able to get Jasper Built, and I then had to edit some of the jpeg2000 files to get it to compile correctly. Specifically, I had to add in the include path to the Makefile in  qtjp2imageformat/plugin, and also the directoy for the Library linking, so heres what those two lines look like:

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  -lQtGui -L/usr/lib64/mysql -L/usr/lib64/qt4/lib64 -L/usr/X11R6/lib64 -lQtCore -lpthread

After finally getting qtjp2 to compile, I moved the generated .so file to
/usr/lib64/qt4/plugins/imageformats/

which has the following files now

libqgif.so   libqico.so   libqjpeg.so  libqmng.so   libqsvg.so   libqtiff.so  libqtjp2.so

And now when I compile my software in QT Creator, it compiles fine, but when it is running and gets to the part where I try to load the .jp2, I get the following:


/home/dcole/IM/work/ext/VC/IMViewer-build-desktop/IMViewer: symbol lookup error: /usr/lib64/qt4/plugins/imageformats/libqtjp2.so: undefined symbol: jas_init

I tried adding the directory /home/dcole/software/jasper-1.900.1/lib to my LD_LIBRARY_PATH but it gives me the same error message.

Any ideas? Do I really need to still have jasper in my LD path even after I am using another library built from jasper? seems kind of cumbersome.
________________________________________
From: qt-interest-bounces+dcole=integrity-apps.com at qt.nokia.com [qt-interest-bounces+dcole=integrity-apps.com at qt.nokia.com] on behalf of Thiago Macieira [thiago at kde.org]
Sent: Tuesday, June 07, 2011 12:04 PM
To: qt-interest at qt.nokia.com
Subject: Re: [Qt-interest] Building JPEG2000 image plugin

On Tuesday, 7 de June de 2011 15:53:52 Cole, Derek wrote:
> Sorry..prematurely sent that last email.
>
> Anyhow..I added the line
>
> include(./qtjp2imageformat/qtjp2imageformat.pro)
>
> to my actual project's .pro file

That's not how to do it. You have to compile the plugin and install it to
somewhere where your Qt will find it (i.e., a path in QT_PLUGIN_PATH). You'll
see other image format loaders there: search for the libqgif.so and
libqjpeg.so. That's where you have to put the libqjp2.so file.

--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
_______________________________________________
Qt-interest mailing list
Qt-interest at qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt-interest



More information about the Qt-interest-old mailing list