Results 1 to 8 of 8

Thread: "Cannot find -lqjpeg" error when compiling QT application in static mode

  1. #1

    Default "Cannot find -lqjpeg" error when compiling QT application in static mode

    hello, everyone!

    I am trying to compile a QT application in static (release configuration) mode using Nokia's QT Creator v.4.7.0 under Windows 7. I compiled QT itself statically as per standard instructions here. However, despite running configure.exe with -qt-libjpeg I am still getting the following error:

    Qt Code:
    1. mingw32/bin/ld.exe: cannot find -lqjpeg
    2. collect2: ld returned 1 exit status
    To copy to clipboard, switch view to plain text mode 

    .pro file does contain QTPLUGIN += qjpeg

    .cpp file does contain Q_IMPORT_PLUGIN(qjpeg)

    The project I am trying to compile is called CutyCapt and can be downloaded here.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: "Cannot find -lqjpeg" error when compiling QT application in static mode

    However, despite running configure.exe with -qt-libjpeg I am still getting the following error:
    Did you look if the build process actually succeed in building qt-libjpeg as well?
    Does lib actually exists?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3

    Default Re: "Cannot find -lqjpeg" error when compiling QT application in static mode

    qjpegd4.dll was successfully compiled in the plugins/imageformats directory. Should there be anything else? If so, how do I selectively compile only the plugins themselves (to avoid waiting for 3 hours for QT to recompile)?

    I apologize if my question is stupid...

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: "Cannot find -lqjpeg" error when compiling QT application in static mode

    mingw32/bin/ld.exe: cannot find -lqjpeg
    qjpegd4.dll was successfully compiled in the plugins/imageformats directory.
    From what you have posted so far, it looks more like you are building a in release mode (you project) but linking to a debug Qt.
    Do you have a release Qt build as well?
    You can try changing your project built to debug and see if it helps.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  5. #5

    Default Re: "Cannot find -lqjpeg" error when compiling QT application in static mode

    I have qjpeg.dll as well, so that's not the problem.

    It seems that I lack qjpeg.a, not qjpeg.dll. However, no matter what parameters I pass to configure.exe, I can't get mingw32 to compile the imageformats libraries for static projects. I only get qjpeg4.a, which is the static version of the library. Any suggestions?

    Perhaps someone could zip his c:/qt/static/plugins/imageformats folder and upload it? This seems like the easiest solution.

    Thanks.

  6. #6
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: "Cannot find -lqjpeg" error when compiling QT application in static mode

    I am trying to compile a QT application in static
    Ok, I missed it when I first read your post...

    I can't get mingw32 to compile the imageformats libraries for static projects. I only get qjpeg4.a, which is the static version of the library.
    I don't get it...
    qjpeg4.a is as you say the static lib, and the static lib is what you want... so I am confused with the problem you have.
    What is it then that you are looking for?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  7. #7

    Default Re: "Cannot find -lqjpeg" error when compiling QT application in static mode

    I managed to finally compile the static version of the qjpeg library (libqjpeg.a) by removing the -qt-libjpeg parameter when executing configure.exe. It seems that by setting that parameter, you are telling Mingw32 to take the existing dynamic lib (?).

    Now I only need to figure out how to do the same with qlibtiff and qlibgif.

    >qjpeg4.a is as you say the static lib

    As far as I understand qjpeg4 is a dynamic lib, as it contains the version number and takes only several kilobytes. qjpeg.a is the static lib.

    I apologize if I'm not clear, I'm new to advanced QT compilation.

  8. #8
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: "Cannot find -lqjpeg" error when compiling QT application in static mode

    As far as I understand qjpeg4 is a dynamic lib, as it contains the version number and takes only several kilobytes. qjpeg.a is the static lib.
    Actually no.
    *.so or *.dll are dynamic.
    *.a or *.lib are static (respectively).
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Replies: 5
    Last Post: 17th May 2011, 11:47
  2. Replies: 4
    Last Post: 20th September 2010, 10:42
  3. Replies: 2
    Last Post: 7th September 2009, 21:13
  4. The compiler error:"cannot find -lQtGuid4"
    By osmanthus in forum Installation and Deployment
    Replies: 1
    Last Post: 7th January 2009, 06:58
  5. QFile Problem~ "Unknow error" in "open(QIODevice::ReadWrite)"
    By fengtian.we in forum Qt Programming
    Replies: 3
    Last Post: 23rd May 2007, 15:58

Tags for this Thread

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.