×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User
    Join Date
    Dec 2004
    Posts
    27

    How to package and deploy libraries with Qt Creator

    Hello,

    what is the correct way to package and deploy a library to N9 with Qt Creator? I have a project that produces a library and one that uses it, but when I compile the latter I get the following error:

    dpkg-shlibdeps: failure: no dependency information found for /QtSDK/Madde/sysroots/harmattan_sysroot_10.2011.34-1_slim/usr/lib/libtestlib.so.1 (used by debian/testlibclient/opt/testlibclient/bin/testlibclient).
    dh_shlibdeps: command returned error code 512
    make: *** [binary-arch] Error 1
    dpkg-buildpackage: failure: debian/rules binary gave error exit status 2
    Packaging Error: Command '/QtSDK/Madde/bin/mad dpkg-buildpackage -nc -uc -us' failed.Exit code: 2
    Error while building project testlibclient (target: Harmattan)
    When executing build step 'Create Debian Package'

    To reproduce the problem, create a new "C++ library" project in Qt creator (e.g. "testlib") and build it for harmattan target, then create a Qt Quick application project and add LIBS += -ltestlib to the project file. Building the second project will give the error above.

    Note that I do have a "deploy to sysroot" step in my library project, and the library is correctly copied to the sysroot.

    Many thanks in advance!

  2. #2
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: How to package and deploy libraries with Qt Creator

    It fails because your lib is not found in the predefined paths.
    Please add LIBS += -L library_path

  3. #3
    Registered User
    Join Date
    Dec 2004
    Posts
    27

    Re: How to package and deploy libraries with Qt Creator

    Thanks, but if that was the case shouldn't the build fail at link time rather than package creation? As far as I can tell the library is installed in the sysroot and is found in the predefined paths.

  4. #4
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: How to package and deploy libraries with Qt Creator

    Quote Originally Posted by il_bale View Post
    if that was the case shouldn't the build fail at link time rather than package creation?
    Correct, since dpkg-shlibdeps often prints out error messages in the console and
    dpkg-buildpackage: failure: debian/rules binary gave error exit status 2
    is a very generic error message, I thought you had forgotten to paste the linker error messages.

    As far as I can tell the library is installed in the sysroot and is found in the predefined paths.
    I checked carefully the error message you got and the lib is in the correct path.

    The package creation fails because dpkg-shlibdeps cannot found dependency info about your lib.
    Your library should install a /var/lib/dpkg/info/package.shlibs.
    To generate such file you need to uncomment dh_makeshlibs line in the debian/rules file of your lib.

  5. #5
    Registered User
    Join Date
    Dec 2004
    Posts
    27

    Re: How to package and deploy libraries with Qt Creator

    Quote Originally Posted by gnuton View Post
    The package creation fails because dpkg-shlibdeps cannot found dependency info about your lib.
    Your library should install a /var/lib/dpkg/info/package.shlibs.
    To generate such file you need to uncomment dh_makeshlibs line in the debian/rules file of your lib.
    Thanks. I did that, but now the packaging of the library fails with this error message:

    dh_makeshlibs: /usr/share/debhelper/autoscripts/postinst-makeshlibs does not exist
    make: *** [binary-arch] Error 1
    dpkg-buildpackage: failure: debian/rules binary gave error exit status 2
    Packaging Error: Command '/home/fbalestr/QtSDK/Madde/bin/mad dpkg-buildpackage -nc -uc -us' failed.Exit code: 2
    Error while building project testlib (target: Harmattan)
    When executing build step 'Create Debian Package'

  6. #6
    Registered User
    Join Date
    Jan 2008
    Posts
    7

    Re: How to package and deploy libraries with Qt Creator

    I have the exact same issue. After "no dependency information found" I uncommented "dh_makeshlibs" and ended up with this error:

    debian/rules build
    Packaging Error: Command '/home/mck182/QtSDK/Madde/bin/mad dpkg-buildpackage -nc -uc -us' failed.Exit code: 2
    Error while building project n9-barcode-reader (target: Harmattan)
    When executing build step 'Create Debian Package'

    il_bale, have you solved your problem?

    Also, what is the best way to create and deploy an app for harmattan with a library?

  7. #7
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    200

    Re: How to package and deploy libraries with Qt Creator

    You should really show the real error message from "Compile Output" window. Anyway I did some tests and noticed that QT Creator forcefully runs dh_shlibdeps even if it commented out with '#'. I added another '#' and only after that dh_shlibdebs.

    So try with
    Code:
    ##	dh_shlibdeps
    Sound weird because it is weird. I tested this with "Qt Widget Project" created with Qt Creator

  8. #8
    Registered User
    Join Date
    Dec 2004
    Posts
    27

    Re: How to package and deploy libraries with Qt Creator

    Quote Originally Posted by mck182 View Post
    il_bale, have you solved your problem?
    Unfortunately not yet.

  9. #9
    Registered User
    Join Date
    Jan 2008
    Posts
    7

    Re: How to package and deploy libraries with Qt Creator

    Quote Originally Posted by mikkovtr View Post
    You should really show the real error message from "Compile Output" window.
    That's what I did. That's the whole error from "Compile output".

    Anyway I made the lib install itself into /opt/usr/lib and then in the app .pro file I set

    "QMAKE_RPATHDIR += /opt/usr/lib"

    then commented out the dh_shlibdeps and now it works \o/

    Thanks mikkovtr.

  10. #10
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    200

    Re: How to package and deploy libraries with Qt Creator

    Quote Originally Posted by mck182 View Post
    That's what I did. That's the whole error from "Compile output".
    Ah, sorry. I have much more verbose output. But great that it builds, hopefully package works on device too.

  11. #11
    Registered User
    Join Date
    Jan 2008
    Posts
    7

    Re: How to package and deploy libraries with Qt Creator

    Yeah, it works For future reference - one can enable verbose output by uncommenting the line "export DH_VERBOSE=1" in rules file.

Similar Threads

  1. In Qt Creator Cannot Qt Libraries doesn't have completion
    By bernardnapoleon in forum [Archived] Beginning Qt
    Replies: 1
    Last Post: 2011-09-14, 12:34
  2. Deploy Qt Creator App to N8 from Mac SDK? Frustrated.
    By franklovecchio in forum [Archived] Qt SDKs and Tools
    Replies: 1
    Last Post: 2010-12-27, 18:49
  3. fail to deploy from Nokia Qt SDK for Mac in Qt Creator
    By ovjo12 in forum [Archived] Qt SDKs and Tools
    Replies: 4
    Last Post: 2010-07-23, 14:38
  4. sis package with STLPort libraries
    By dakosurf in forum Symbian
    Replies: 3
    Last Post: 2008-04-04, 06:05
  5. Replies: 5
    Last Post: 2007-11-05, 06:45

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×