×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Aug 2011
    Posts
    11

    [Solved] How to get library path relative to MADDE sysroot in .pro file?

    I have a Qt console project with harmattan as the target. I added this line to project file.

    Code:
    LIBS +=/usr/lib/libgconf-2.so
    Build failed with error "File format not recognized", which I assume is because madde is looking at the host system's (Ubuntu-amd64) /usr/lib/ folder and not at /opt/QtSDK/Madde/sysroots/harmattan-nokia-meego-arm-sysroot-1122-slim/usr/lib.

    I tried linking with

    Code:
    LIBS += -lgconf-2
    But it failed with error "cannot find -lgconf-2".

    How can I include the path "/opt/QtSDK/Madde/sysroots/harmattan-nokia-meego-arm-sysroot-1122-slim/usr/lib" without actually hard-coding it in Qt project file?

    Thanks for any suggestions.
    Last edited by scifi.guy; 2011-10-12 at 05:50. Reason: Solved

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

    Re: How to get library path relative to MADDE sysroot in .pro file?

    I suggest you to use pkg-config.
    To use it you need to add the following lines to your .pro file.

    CONFIG += link_pkgconfig
    PKGCONFIG += gconf-2.0

    It will automatically add gconf include path and libs to the INCLUDES and LIBS vars.

  3. #3
    Registered User
    Join Date
    Aug 2011
    Posts
    11

    Re: How to get library path relative to MADDE sysroot in .pro file?

    Thanks gnuton.

    I tried using PKGCONFIG. For some reason gconf-2.0 paths are not getting added to INCLUDES and LIBS for harmattan target in Qt . The syntax works perfectly fine for a Fremantle target.

    I used this syntax in .pro file.

    Code:
    CONFIG += link_pkgconfig
    PKGCONFIG += glib-2.0 gconf-2.0
    During build, this is the command being executed by Qt creator.

    Code:
    g++ -c -pipe -g -fPIC -D_REENTRANT -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -Wall -W -DQ_WS_MAEMO_6 -DQT_DBUS_LIB -DQT_SQL_LIB -DQT_CORE_LIB -DQT_SHARED -I/opt/QtSDK/Madde/sysroots/harmattan-nokia-meego-arm-sysroot-1122-slim/usr/share/qt4/mkspecs/linux-g++-maemo -I../../../vicar-0.7/src/vicar-lib -I/opt/QtSDK/Madde/sysroots/harmattan-nokia-meego-arm-sysroot-1122-slim/usr/include/qt4/QtCore -I/opt/QtSDK/Madde/sysroots/harmattan-nokia-meego-arm-sysroot-1122-slim/usr/include/qt4/QtSql -I/opt/QtSDK/Madde/sysroots/harmattan-nokia-meego-arm-sysroot-1122-slim/usr/include/qt4/QtDBus -I/opt/QtSDK/Madde/sysroots/harmattan-nokia-meego-arm-sysroot-1122-slim/usr/include/qt4 -Icpp/.mocs -I../../../vicar-0.7/src/vicar-lib -I. -o cpp/.objs/gconfutility.o ../../../vicar-0.7/src/vicar-lib/cpp/gconfutility.cpp 
    In file included from ../../../vicar-0.7/src/vicar-lib/cpp/gconfutility.cpp:7:
    ../../../vicar-0.7/src/vicar-lib/cpp/gconfutility.h:11: fatal error: gconf/gconf-client.h: No such file or directory
    Notice that glib-2.0 headers are included properly but gconf-2.0 path is missing. If I select Fremantle target, both glib-2.0 and gconf-2.0 paths are included properly. Even if I add the gconf path to INCLUDEPATH variable, the build fails because Qt creator does not link gconf-2.0 library for harmattan target. The harmattan target does have the gconf-2.0 library in /usr/lib folder.

    Is there a workaround to fix this issue?

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

    Re: How to get library path relative to MADDE sysroot in .pro file?

    Hi,
    I double checked my QtSDK and it has gconf pkgconfig and include files.
    Try to update your SDK to latest release.
    If it doesn't help then, I could give you a tarball containing
    gconf files for your harmattan target.

    Code:
    gnuton@joshua:~/QtSDK-9.15-TEST$ find ./ -name gconf-2.0.pc  -print
    ./Maemo/4.6.2/sysroots/fremantle-arm-sysroot-20.2010.36-2-slim/usr/lib/pkgconfig/gconf-2.0.pc
    ./Madde/sysroots/harmattan-nokia-meego-arm-sysroot-1134-slim/usr/lib/pkgconfig/gconf-2.0.pc
    ./Madde/sysroots/harmattan-meego-arm-sysroot-1134-slim/usr/lib/pkgconfig/gconf-2.0.pc
    Code:
    gnuton@joshua:~/QtSDK-9.15-TEST$ find ./ -name gconf-client.h -print./Maemo/4.6.2/sysroots/fremantle-arm-sysroot-20.2010.36-2-slim/usr/include/gconf/2/gconf/gconf-client.h
    ./Madde/sysroots/harmattan-nokia-meego-arm-sysroot-1134-slim/usr/include/gconf/2/gconf/gconf-client.h
    ./Madde/sysroots/harmattan-meego-arm-sysroot-1134-slim/usr/include/gconf/2/gconf/gconf-client.h

  5. #5
    Registered User
    Join Date
    Aug 2011
    Posts
    11

    Re: How to get library path relative to MADDE sysroot in .pro file?

    I think we are closing in on the issue here.

    Recently I cleaned up my old Qt installation and re-installed Qt SDK v1.1.3 using offline installer. I am missing gconf-2.0.pc and include files in harmattan target.

    Code:
    scifi@ubuntu-lucid:/opt/QtSDK$ find -name gconf-2.0.pc
    find: `./Simulator/OviNotifications/include': Permission denied
    find: `./Simulator/Qt/gcc/imports/com/nokia/OviNotifications': Permission denied
    ./Maemo/4.6.2/sysroots/fremantle-arm-sysroot-20.2010.36-2-slim/usr/lib/pkgconfig/gconf-2.0.pc
    scifi@ubuntu-lucid:/opt/QtSDK$ find -name gconf-client.h
    find: `./Simulator/OviNotifications/include': Permission denied
    find: `./Simulator/Qt/gcc/imports/com/nokia/OviNotifications': Permission denied
    ./Maemo/4.6.2/sysroots/fremantle-arm-sysroot-20.2010.36-2-slim/usr/include/gconf/2/gconf/gconf-client.h
    I will try the online installer this time and see if it makes any difference. Otherwise is there any other way to re-install just the harmattan target in MADDE?

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

    Re: How to get library path relative to MADDE sysroot in .pro file?

    I think you can simply re-install it using the updater (HELP > Start updater > Package Manager > Experimental > Harmttan target)

  7. #7
    Registered User
    Join Date
    Aug 2011
    Posts
    11

    Re: How to get library path relative to MADDE sysroot in .pro file?

    I think the reason for missing gconf files was because I selected only "Meego 1.2 Harmattan API" and excluded "Harmattan Platform API" during installation. Now I installed Harmattan Platform API, and updated everything using package manager. GConf is now linked successfully.

    Thanks gnuton for your guidance and patience

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

    Re: How to get library path relative to MADDE sysroot in .pro file?

    You are welcome! ;D

Similar Threads

  1. Error while Accessing files with relative path
    By jaspindersb in forum Symbian
    Replies: 3
    Last Post: 2009-09-15, 05:33
  2. Can't use relative paths in pkg file
    By ed_welch in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2008-06-25, 12:52
  3. How can I access file through relative path
    By beta55 in forum Symbian
    Replies: 8
    Last Post: 2006-03-07, 02:27
  4. Library path
    By tstiemer in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2003-03-19, 23:37

Posting Permissions

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