Results 1 to 7 of 7

Thread: libqjpeg troubles

  1. #1
    Join Date
    Jun 2006
    Location
    Sweden
    Posts
    99
    Thanks
    11
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default libqjpeg troubles

    My application loads jpeg images with Qimage. Things work fine when compiling with both debug and release, however when i move the app to a computer that doesn't have Qt installed the application won't load the image. I tried adding QTPLUGIN += qjpeg to the .pro file and used Q_IMPORT_PLUGIN(qjpeg) in my code. However, when i add this i get the following compiler error:

    P:/QT/MinGW-gcc-3.4.2/bin/mingw32-make.exe -f Makefile.Debug
    mingw32-make.exe[1]: Entering directory `H:/workspace/prototype/planner'
    g++ -c -g -g -frtti -fexceptions -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT
    g++ -DQT_DLL -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB
    g++ -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN
    g++ -I"P:/QT/qt-win-4.1.4-mingw-20060823/include/QtCore"
    g++ -I"P:/QT/qt-win-4.1.4-mingw-20060823/include/QtNetwork"
    g++ -I"P:/QT/qt-win-4.1.4-mingw-20060823/include/QtGui"
    g++ -I"P:/QT/qt-win-4.1.4-mingw-20060823/include/QtXml"
    g++ -I"P:/QT/qt-win-4.1.4-mingw-20060823/include" -I"."
    g++ -I"P:/QT/qt-win-4.1.4-mingw-20060823/include/ActiveQt" -I"debug"
    g++ -I"." -I"p:\QT\qt-win-4.1.4-mingw-20060823\mkspecs\win32-g++" -o
    g++ debug\mapdrawwidget.o ..\mapdraw\mapdrawwidget.cpp -mthreads
    g++ -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import
    g++ -Wl,-enable-runtime-pseudo-reloc -Wl,-subsystem,windows -o
    g++ "debug\planner.exe" object_script.planner.Debug
    g++ -L"p:\QT\qt-win-4.1.4-mingw-20060823\lib" -lmingw32 -lqtmaind
    g++ -lQtXmld4 -lQtGuid4 -lQtNetworkd4 -lQtCored4
    g++ -LP:\QT\qt-win-4.1.4-mingw-20060823\plugins/imageformats/ -lqjpegd
    P:\QT\MinGW-20060823\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\ mingw32\bin\ld.exe: cannot find -lqjpegd
    collect2: ld returned 1 exit status
    mingw32-make.exe[1]: *** [debug\planner.exe] Error 1
    mingw32-make.exe[1]: Leaving directory `H:/workspace/prototype/planner'
    P:\QT\MinGW-gcc-3.4.2\bin\mingw32-make.exe: *** [debug] Error 2

    I'm using mingw32 3.4.2 with Qt 4.1.4 and i've compiled it to use Qt's own jpeg library instead of the hosts native jpeg support.

    Thanks in advance!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: libqjpeg troubles

    Quote Originally Posted by TheRonin
    cannot find -lqjpegd
    It looks like you don't have a debug version of QJPEG plugin.

  3. #3
    Join Date
    Jun 2006
    Location
    Sweden
    Posts
    99
    Thanks
    11
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: libqjpeg troubles

    Iindeed, the compiler doesn't seem to find the release version either. I have qjpeg1.dll and qjpegd1.dll in my Qt/plugins/imageformats/ folder though. Aren't those the right ones? If not, where would i find the correct ones?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: libqjpeg troubles

    Quote Originally Posted by TheRonin
    I have qjpeg1.dll and qjpegd1.dll in my Qt/plugins/imageformats/ folder though. Aren't those the right ones?
    Yes, but for linking you need libqjpeg.a or libqjpegd.a. Do you have these files somewhere?

    Anyway, if you want to use QJPEG plugin on a system where Qt isn't installed, just create a imageformats subdirectory in the directory where your executable is and place qjpeg1.dll there.

  5. #5
    Join Date
    Jun 2006
    Location
    Sweden
    Posts
    99
    Thanks
    11
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: libqjpeg troubles

    Well i have libqjpeg1.a and libqjpegd1.a in the same imageformats directory as the dlls.

    Thanks for the tip with the dll's in the executable directory. Works devinely. If and when i get the compilation to work with libqjpeg, will i still need to distribute the dll's with my app? if so, what do i gain from using the qjpeg plugin?

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: libqjpeg troubles

    Quote Originally Posted by TheRonin
    Well i have libqjpeg1.a and libqjpegd1.a in the same imageformats directory as the dlls.
    I guess that the problem is in that "1" at the end.

    Quote Originally Posted by TheRonin
    If and when i get the compilation to work with libqjpeg, will i still need to distribute the dll's with my app? if so, what do i gain from using the qjpeg plugin?
    "static plugins" mechanism was intended for use with static linking.

    With dynamic linking, you will have to distribute DLLs and your application won't start without them. If you were using plugins, it would start --- just missing plugins wouldn't be available.

    Also it might be useful for troubleshooting "plugin not loaded" problems, since you link against the plugin, instead of loading it at runtime.

  7. #7
    Join Date
    Jun 2006
    Location
    Sweden
    Posts
    99
    Thanks
    11
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Lightbulb Re: libqjpeg troubles

    Ok thanks!

    As far as the 1 at the end of the filename is concerned, that's Qt's doing! When i try to remove it the compiler whines about methods and functions in the plugin.

    But if i understand you correctly then the solution is that i haven't built qt for static linking so the plugins aren't either. If i were to configure qt for static linking i'm confident the plugin dll's will get the proper names and my troubles will go away. I'm thinking that the error was caused by me loading a plugin for static linking when i was linking dynamically.

    That's my theory at this point, but please let me know if i'm wrong

Similar Threads

  1. lupdate *.pro troubles
    By jeff_s in forum Qt Programming
    Replies: 1
    Last Post: 28th July 2006, 10:07
  2. QTextEdit troubles?!
    By Jojo in forum Qt Programming
    Replies: 2
    Last Post: 21st February 2006, 16:54

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.