Results 1 to 19 of 19

Thread: Static compile with jpg support

  1. #1
    Join Date
    Mar 2006
    Posts
    58
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Static compile with jpg support

    Can I do a static compile with open source version and still get jpg support for the app?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Static compile with jpg support

    Yes. You have to compile jpg support into the library itself (not as a plugin).

  3. #3
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Thanks
    9
    Thanked 27 Times in 27 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: Static compile with jpg support

    Are you can use jpg in dynamic compile with open source version ? If yes so i think you can do it with static compile
    a life without programming is like an empty bottle

  4. #4
    Join Date
    Mar 2006
    Posts
    58
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Static compile with jpg support

    Quote Originally Posted by wysota
    Yes. You have to compile jpg support into the library itself (not as a plugin).
    Sorry for the newbie questions, but, how do i go about doing this?

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Static compile with jpg support

    Depends on which Qt version you use. For Qt4 it should be enough to compile Qt in static mode (check FAQ for details) and to use libjpeg which comes with Qt (or to have a static libjpeg installed in the system). For Qt3 (AFAIR) there was some switch to compile jpeg support directly into Qt. Run configure with "-help" parameter and look for it.

  6. #6
    Join Date
    Mar 2006
    Posts
    58
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Static compile with jpg support

    I'm using Qt 4.1.1. With the open source version for windows(installed with the .exe) my program works fine. I can manipulate, etc. jpeg images. But if I try the open source "source" and build it, I cannot work with jpeg images. (configure -static)
    Perhaps I am missing a switch during "configure"...

    Also, how do I use "libjpeg"?

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Static compile with jpg support

    -no-libjpeg ........ Do not compile the plugin for JPEG support.
    -qt-libjpeg ........ Use the libjpeg bundled with Qt.
    -system-libjpeg .... Use libjpeg from the operating system. See http://www.ijg.org

  8. #8
    Join Date
    Mar 2006
    Posts
    58
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Static compile with jpg support

    Quote Originally Posted by wysota
    -no-libjpeg ........ Do not compile the plugin for JPEG support.
    -qt-libjpeg ........ Use the libjpeg bundled with Qt.
    -system-libjpeg .... Use libjpeg from the operating system. See http://www.ijg.org
    ah...that is "libjpeg"...
    I have already tried that "configure -static -release -qt-libjpeg" and built, but the program will not work. (identical program with shared works )

  9. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Static compile with jpg support

    Check if Qt builds a static libjpeg library. If not, this could be a bug and should be reported to TT.

  10. #10
    Join Date
    Mar 2006
    Posts
    58
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Static compile with jpg support

    Quote Originally Posted by wysota
    Check if Qt builds a static libjpeg library. If not, this could be a bug and should be reported to TT.
    Where would I check to see if it did build a "libjpeg" library?
    Sorry for such newbee-ish questions....

  11. #11
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Static compile with jpg support

    Probably somewhere around src/3rdparty/libjpeg directory relative to unpacked Qt source

  12. #12
    Join Date
    Mar 2006
    Posts
    58
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Static compile with jpg support

    src\3rdparty\libjpeg exists.......so.......?

  13. #13
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Static compile with jpg support

    So nothing check if Qt compiles a static version of the library when you pass -static and -qt-libjpeg to configure and start compilation. If you have problems, use Google. After all, this is Qt devoted forum not a "general compilation issues" one.

  14. #14
    Join Date
    Mar 2006
    Posts
    58
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Static compile with jpg support

    Qt builds just fine with configure -release -static -qt-libjpeg
    Only thing is, I cannot get a program to work that manipulates, opens, saves, etc. a jpg....
    It compiles fine, it just gives an error when trying to open a jpg.
    The exact same code works when using Qt as shared, though....

    It's no big deal, I am just testing the waters against MFC (my "limited" background)

  15. #15
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Static compile with jpg support

    I know Qt builds fine. But after that build is completed, check if a static version of libjpeg was built (it should be in the directory already mentioned) -- it'll probably be called libjpeg.a or jpeg.a or something like that... I don't know Windows naming schemes for static libraries (but it surely won't have a "dll" extension).

  16. #16
    Join Date
    Mar 2006
    Posts
    58
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Static compile with jpg support

    Thanks....
    There is not any file there with that name....
    However in \plugins\imageformats there is a "libqjpeg.a"....
    Perhaps this is what I need? If so, how to use?

    Again, I thank you for your perserverance....

  17. #17
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Static compile with jpg support

    Yes, this might be what you need (it's a static version of the image plugin). You need to link your application with it. Consult QMake reference for details.

  18. #18
    Join Date
    Mar 2006
    Posts
    58
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Static compile with jpg support

    In the .pro file I added:
    win32:LIBS += path\to\thelibrary
    but that still did not work......
    Any idea if I am on the right track here.

  19. #19
    Join Date
    Nov 2006
    Posts
    5
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Static compile with jpg support

    Either pass the path of the .a file or copy the .a file to your working folder and
    add the following lines to your .pro file.


    LIBS += -L . -lqjpeg

    Along with the Qt Assistant notes for compling static plugins into your app, this should help u accomplish your task.

Similar Threads

  1. Qt 4.4.3 commercial on Kubuntu 8.10
    By Micawber in forum Installation and Deployment
    Replies: 5
    Last Post: 17th February 2010, 01:02
  2. qtgui4.dll error in visual c++ 2005
    By Comptrol in forum Installation and Deployment
    Replies: 33
    Last Post: 19th June 2008, 07:18
  3. Qt-4.4.0 installation error in linux
    By babu198649 in forum Installation and Deployment
    Replies: 4
    Last Post: 27th May 2008, 14:35
  4. Replies: 16
    Last Post: 23rd May 2008, 10:12
  5. Access to PostgreSQL DB on a linux server
    By rmagro in forum Qt Programming
    Replies: 28
    Last Post: 13th March 2008, 09:02

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.