Results 1 to 12 of 12

Thread: Implement jpegsrc.v8b.tar.gz LINUX

  1. #1
    Join Date
    Nov 2010
    Location
    Monterrey, Nuevo Leon, Mexico
    Posts
    8
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11

    Default Implement jpegsrc.v8b.tar.gz LINUX

    Hi all,

    I download lgpl qt libraries 4.7.1 for Linux/X11.

    I have a source code that implement jpegsrc.v8b.tar.gz and I'd like to configure my qt to implement this library.

    If I configure qt of this way, my jpegv8 library is not loaded. The system jpeg library is loaded:
    ./configure -prefix /home/ivan/WinXP/Ivan_Maldonado/PeekDocuments/VideoProject/QtInstallers -release -opensource -fast -make tools -ljpeg -system-libjpeg -optimized-qmake

    I know Qt loaded jpeg system library. For example:
    #ldd bin/moc
    linux-gate.so.1 => (0x00ddf000)
    libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x04c48000)
    /lib/ld-linux.so.2 (0x0039d000)

    I'd like to build and install jpegv8 in a directory and configure qt to use this jpegv8 library beside system one.

    or

    If I have my source code, how can I generate a Makefile to consider jpegv8 library and not generates this problem:

    jpeg-dcom.o: In function read_jpeg_file
    jpeg-dcom.c:(.text+0x37): undefined reference to jpeg_std_error
    jpeg-dcom.c:(.text+0x80): undefined reference to jpeg_CreateDecompress
    jpeg-dcom.c:(.text+0x92): undefined reference to jpeg_stdio_src
    jpeg-dcom.c:(.text+0xa2): undefined reference to jpeg_read_header
    jpeg-dcom.c:(.text+0x146): undefined reference to jpeg_start_decompress
    jpeg-dcom.c:(.text+0x1a8): undefined reference to jpeg_read_scanlines
    jpeg-dcom.c:(.text+0x1d9): undefined reference to jpeg_finish_decompress
    jpeg-dcom.c:(.text+0x1e1): undefined reference to jpeg_destroy_decompress
    jpeg-dcom.c:(.text+0x24a): undefined reference to jpeg_destroy_decompress
    collect2: ld returned 1 exit status
    make: *** mybinfile Error 1

    If I modify this line in my Makefile
    - LIBS=$(SUBLIBS) -L/usr/local/Trolltech/Qt-4.7.1/lib -lQtGui -L/usr/local/lib -L/usr/local/Trolltech/Qt-4.7.1/lib -L/usr/X11R6/lib -lQtNetwork -lQtCore -lpthread
    - LIBS=$(SUBLIBS) -L/usr/local/Trolltech/Qt-4.7.1/lib -lQtGui -L/usr/local/lib -L/usr/local/Trolltech/Qt-4.7.1/lib -L/usr/X11R6/lib -lQtNetwork -lQtCore -lpthread -ljpeg

    The problem below disappears and I my bin file is generated. At the moment of execute my bin file I get this error:


    # ./mybinfile
    ./mybinfile: error while loading shared libraries: libjpeg.so.8: cannot open shared object file: No such file or directory
    # ldd mybinfile
    linux-gate.so.1 => (0x00912000)
    libjpeg.so.8 => not found
    ....

  2. #2
    Join Date
    Nov 2010
    Location
    Monterrey, Nuevo Leon, Mexico
    Posts
    8
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11

    Default Re: Implement jpegsrc.v8b.tar.gz LINUX

    In google I found -rpath and -rpath-link variables that can be set. Do you think this can help?

    Ragards and thanks in advance...

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Implement jpegsrc.v8b.tar.gz LINUX

    I'd compile and install the version 8b JPEG library somewhere and then try the -I and -L options to configure:
    -I <string> ........ Add an explicit include path.
    -L <string> ........ Add an explicit library path.
    before I started editing generated Makefiles or hard coding library paths into executables (with rpath).

    Of course, you could just update your system library.

    At run time the shared library file must be located in the system library path (see /etc/ld.so.conf) or in the LD_LIBRARY_PATH of the running environment.

  4. #4
    Join Date
    Nov 2010
    Location
    Monterrey, Nuevo Leon, Mexico
    Posts
    8
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11

    Default Re: Implement jpegsrc.v8b.tar.gz LINUX

    Hi ChrisW67,

    Sorry by the inconvenience but may be more specific? I mean, provide an example.

    For example at the moment of execute ./configure -I/usr/local/*.so -L/usr/local.

    Do you have extra documentation about rpath?

    Regards and thanks in advance
    Iván Maldonado Zambrano

  5. #5
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Implement jpegsrc.v8b.tar.gz LINUX

    Sorry, been for a short holiday in New Zealand

    The -I option sets paths to search for include files, not a wildcard list of dynamically loaded library files. Similarly, the -L options sets paths for the linker to search when looking for library files (libjpeg.a and/or libjpeg.so) during linking.

    Assuming that the updated JPEG library files are installed into /usr/local/include, /usr/local/lib etc then:
    Qt Code:
    1. ./configure -I/usr/local/include -L/usr/local/lib
    To copy to clipboard, switch view to plain text mode 
    should do it.

    Rpath is documented in the linker manual page:
    Qt Code:
    1. man ld
    To copy to clipboard, switch view to plain text mode 
    Neither of the configure options controls how the dynamically loaded library (libjpeg.so in this case) is found at runtime: rpath has some impact on this. Using rpath is frowned upon because it makes adapting your software to other environments more difficult: rpath is typically given more weight than the user's environment (LD_LIBRARY_PATH). See also http://en.wikipedia.org/wiki/Rpath_%28linking%29

  6. #6
    Join Date
    Nov 2010
    Location
    Monterrey, Nuevo Leon, Mexico
    Posts
    8
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11

    Default Re: Implement jpegsrc.v8b.tar.gz LINUX

    Hi ChrisW67,

    In this case, what configure option must be set?


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

    Regards and thanks in advance

  7. #7
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Implement jpegsrc.v8b.tar.gz LINUX

    The configure script defaults to automatic detection of the presence of a system JPEG library. If you have the -I and -L options set correctly then it should find yours in preference to the vendor's.

    If you really must set it manually then:
    • Clearly the first option is of no use.
    • The second one will ignore the system JPEG library and also your JPEG library and use whatever is bundled inside Qt (v8 of the library in 4.7.0).
    • That leaves only one option.
    Last edited by ChrisW67; 7th December 2010 at 23:40.

  8. #8
    Join Date
    Nov 2010
    Location
    Monterrey, Nuevo Leon, Mexico
    Posts
    8
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11

    Default Re: Implement jpegsrc.v8b.tar.gz LINUX

    Hi ChrisW67,

    I installed jpeg-8b in this directory:
    /home/ivan/WinXP/Ivan_Maldonado/PeekDocuments/VideoProject/jpeg-8blib

    [root@ivan jpeg-8blib]# ls
    bin include lib share

    Then I created a new *.conf file (jpeg8b.conf) in ld.so.conf.d directory:
    [ivan@ivan ld.so.conf.d]$ pwd
    /etc/ld.so.conf.d
    [ivan@ivan ld.so.conf.d]$ ls -alth
    total 56K
    drwxr-xr-x. 133 root root 8.0K Dec 8 00:58 ..
    drwxr-xr-x. 2 root root 4.0K Dec 8 00:07 .
    -rw-r--r-- 1 root root 74 Dec 8 00:07 jpeg8b.conf
    -rw-r--r-- 1 root root 15 Nov 1 21:31 mysql-i386.conf
    -rw-r--r-- 1 root root 25 Oct 27 11:08 xulrunner-32.conf
    -r--r--r-- 1 root root 63 Oct 18 23:39 kernel-2.6.34.7-61.fc13.i686.PAE.conf
    -r--r--r-- 1 root root 63 Sep 14 22:32 kernel-2.6.34.7-56.fc13.i686.PAE.conf
    -r--r--r-- 1 root root 63 Sep 5 12:49 kernel-2.6.34.6-54.fc13.i686.PAE.conf
    -rw-r--r-- 1 root root 15 Jul 29 08:10 opencv.conf
    -rw-r--r--. 1 root root 20 Dec 22 2009 qt-i386.conf
    [ivan@ivan ld.so.conf.d]$ cat jpeg8b.conf
    /home/ivan/WinXP/Ivan_Maldonado/PeekDocuments/VideoProject/jpeg-8blib/lib

    After that I configured my Qt like this:

    ./configure -prefix /home/ivan/WinXP/Ivan_Maldonado/PeekDocuments/VideoProject/Trolltech/Qt-4.7.1-ljpeg -opensource -I/home/ivan/WinXP/Ivan_Maldonado/PeekDocuments/VideoProject/jpeg-8blib/include -L/home/ivan/WinXP/Ivan_Maldonado/PeekDocuments/VideoProject/jpeg-8blib/lib -ljpeg

    At the moment of type gmake, this error appears:
    gmake[1]: Entering directory `/home/ivan/WinXP/Ivan_Maldonado/PeekDocuments/VideoProject/QtInstallers/qt-everywhere-opensource-src-4.7.1/src/corelib'
    /home/ivan/WinXP/Ivan_Maldonado/PeekDocuments/VideoProject/QtInstallers/qt-everywhere-opensource-src-4.7.1/bin/moc -DQT_SHARED -DQT_BUILD_CORE_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_USE_FAST_OPERATOR_PLUS -DQT_USE_FAST_CONCATENATION -DELF_INTERPRETER=\"/lib/ld-linux.so.2\" -DHB_EXPORT=Q_CORE_EXPORT -DQT_NO_DEBUG -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_HAVE_SSE3 -DQT_HAVE_SSSE3 -DQT_HAVE_SSE4_1 -DQT_HAVE_SSE4_2 -DQT_HAVE_AVX -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++ -I. -I../../include -I../../include/QtCore -I.rcc/release-shared -Iglobal -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -I.moc/release-shared animation/qabstractanimation.h -o .moc/release-shared/moc_qabstractanimation.cpp
    /home/ivan/WinXP/Ivan_Maldonado/PeekDocuments/VideoProject/QtInstallers/qt-everywhere-opensource-src-4.7.1/bin/moc: error while loading shared libraries: libjpeg.so.8: cannot open shared object file: No such file or directory
    gmake[1]: *** [.moc/release-shared/moc_qabstractanimation.cpp] Error 127
    gmake[1]: Leaving directory `/home/ivan/WinXP/Ivan_Maldonado/PeekDocuments/VideoProject/QtInstallers/qt-everywhere-opensource-src-4.7.1/src/corelib'
    gmake: *** [sub-corelib-make_default-ordered] Error 2

    Do you have any idea?

    Regards and thanks in advance

  9. #9
    Join Date
    Nov 2010
    Location
    Monterrey, Nuevo Leon, Mexico
    Posts
    8
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11

    Default Re: Implement jpegsrc.v8b.tar.gz LINUX

    Hi ChrisW67,

    I installed jpeg-8b in this directory:
    /home/ivan/WinXP/Ivan_Maldonado/PeekDocuments/VideoProject/jpeg-8blib

    [root@ivan jpeg-8blib]# ls
    bin include lib share

    Then I created a new *.conf file (jpeg8b.conf) in ld.so.conf.d directory:
    [ivan@ivan ld.so.conf.d]$ pwd
    /etc/ld.so.conf.d
    [ivan@ivan ld.so.conf.d]$ ls -alth
    total 56K
    drwxr-xr-x. 133 root root 8.0K Dec 8 00:58 ..
    drwxr-xr-x. 2 root root 4.0K Dec 8 00:07 .
    -rw-r--r-- 1 root root 74 Dec 8 00:07 jpeg8b.conf
    -rw-r--r-- 1 root root 15 Nov 1 21:31 mysql-i386.conf
    -rw-r--r-- 1 root root 25 Oct 27 11:08 xulrunner-32.conf
    -r--r--r-- 1 root root 63 Oct 18 23:39 kernel-2.6.34.7-61.fc13.i686.PAE.conf
    -r--r--r-- 1 root root 63 Sep 14 22:32 kernel-2.6.34.7-56.fc13.i686.PAE.conf
    -r--r--r-- 1 root root 63 Sep 5 12:49 kernel-2.6.34.6-54.fc13.i686.PAE.conf
    -rw-r--r-- 1 root root 15 Jul 29 08:10 opencv.conf
    -rw-r--r--. 1 root root 20 Dec 22 2009 qt-i386.conf
    [ivan@ivan ld.so.conf.d]$ cat jpeg8b.conf
    /home/ivan/WinXP/Ivan_Maldonado/PeekDocuments/VideoProject/jpeg-8blib/lib

    After that I configured my Qt like this:

    ./configure -prefix /home/ivan/WinXP/Ivan_Maldonado/PeekDocuments/VideoProject/Trolltech/Qt-4.7.1-ljpeg -opensource -I/home/ivan/WinXP/Ivan_Maldonado/PeekDocuments/VideoProject/jpeg-8blib/include -L/home/ivan/WinXP/Ivan_Maldonado/PeekDocuments/VideoProject/jpeg-8blib/lib -ljpeg

    At the moment of type gmake, this error appears:
    gmake[1]: Entering directory `/home/ivan/WinXP/Ivan_Maldonado/PeekDocuments/VideoProject/QtInstallers/qt-everywhere-opensource-src-4.7.1/src/corelib'
    /home/ivan/WinXP/Ivan_Maldonado/PeekDocuments/VideoProject/QtInstallers/qt-everywhere-opensource-src-4.7.1/bin/moc -DQT_SHARED -DQT_BUILD_CORE_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_USE_FAST_OPERATOR_PLUS -DQT_USE_FAST_CONCATENATION -DELF_INTERPRETER=\"/lib/ld-linux.so.2\" -DHB_EXPORT=Q_CORE_EXPORT -DQT_NO_DEBUG -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_HAVE_SSE3 -DQT_HAVE_SSSE3 -DQT_HAVE_SSE4_1 -DQT_HAVE_SSE4_2 -DQT_HAVE_AVX -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++ -I. -I../../include -I../../include/QtCore -I.rcc/release-shared -Iglobal -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -I.moc/release-shared animation/qabstractanimation.h -o .moc/release-shared/moc_qabstractanimation.cpp
    /home/ivan/WinXP/Ivan_Maldonado/PeekDocuments/VideoProject/QtInstallers/qt-everywhere-opensource-src-4.7.1/bin/moc: error while loading shared libraries: libjpeg.so.8: cannot open shared object file: No such file or directory
    gmake[1]: *** [.moc/release-shared/moc_qabstractanimation.cpp] Error 127
    gmake[1]: Leaving directory `/home/ivan/WinXP/Ivan_Maldonado/PeekDocuments/VideoProject/QtInstallers/qt-everywhere-opensource-src-4.7.1/src/corelib'
    gmake: *** [sub-corelib-make_default-ordered] Error 2

    Do you have any idea?

    Regards and thanks in advance

  10. #10
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Implement jpegsrc.v8b.tar.gz LINUX

    It's already been pointed out many times that this isn't a configure problem. You can play with configure until the cows come home, but if the OS can't locate your dynamic library at runtime, your application will fail.

    Put your library in the same directory as your executable as a first step. If that works, adjust your LD_LIBRARY_PATH to include your "standard" location. Better yet, install the library in some standard place where the dynamic linker already expects to find libraries, like /usr/lib or some other appropriate spot.

    The linker is telling you everything you need to know: it doesn't know where your library is. You have to tell it.

    If you're trying to build Qt using a different jpeg library than it was coded for, you're going to fail. No amount of linker magic can overcome a foreign API.

  11. #11
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Implement jpegsrc.v8b.tar.gz LINUX

    You have actually built the JPEG library, haven't you?

    Did you run ldconfig after playing with the global system library search path? In any case, for development purposes you are far better off leaving the system path alone and using the LD_LIBRARY_PATH environment variable (or installing Qt into a location that is already searched).

    The configure command for Qt does not need the repeated -l flags you have given it.

    This really is not rocket science:
    Qt Code:
    1. #!/bin/bash
    2. export MYPROJ=/home/ivan/WinXP/Ivan_Maldonado/PeekDocuments/VideoProject
    3. export MYJPEG=${MYPROJ}/jpeg-8blib
    4. export LD_LIBRARY_PATH=${MYJPEG}/lib
    5. cd ${MYPROJ}/QtInstallers/qt-everywhere-opensource-src-4.7.1
    6. ./configure -I${MYJPEG}/include -L${MYJPEG}/lib -prefix ${MYPROJ}/Trolltech/Qt-4.7.1
    7. make
    To copy to clipboard, switch view to plain text mode 

    The Qt source will happily build and run against this version of libjpeg (my system uses it globally). The version bundled inside Qt is version 8, I assume without the a and b patches. This whole exercise only has some value if Ivan wants something in the a or b patches, otherwise using the Qt bundled libjpeg would be a far easier option.
    Last edited by ChrisW67; 8th December 2010 at 22:39.

  12. The following user says thank you to ChrisW67 for this useful post:

    ivanqt (9th December 2010)

  13. #12
    Join Date
    Nov 2010
    Location
    Monterrey, Nuevo Leon, Mexico
    Posts
    8
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11

    Default Re: Implement jpegsrc.v8b.tar.gz LINUX

    Hi ChrisW67,

    Thanks for your support.

    The last script works great. I'm using this script for linux-embedded.

    At the end I installed libjpeg in /usr directory.
    Example:
    # ./configure -prefix /home/ivan/WinXP/Ivan_Maldonado/PeekDocuments/VideoProject/Trolltech/Qt-4.7.1-ljpeg -opensource -release -fast -system-libjpeg -ljpeg

    Regards and thanks for all

Similar Threads

  1. How does Qt implement layers?
    By FinderCheng in forum Qt Programming
    Replies: 1
    Last Post: 16th October 2009, 13:12
  2. Trying to implement QMainWindow...
    By winston2020 in forum Qt Programming
    Replies: 2
    Last Post: 23rd October 2008, 19:12
  3. how to implement this widget
    By pencilren in forum Qt Programming
    Replies: 2
    Last Post: 15th June 2007, 11:10
  4. What's the best way to implement a MainWindow
    By darkadept in forum Qt Programming
    Replies: 5
    Last Post: 5th February 2007, 17:46
  5. how to implement it ?
    By qtopiahooo in forum Qt Programming
    Replies: 3
    Last Post: 25th October 2006, 17:01

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
  •  
Qt is a trademark of The Qt Company.