×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Nov 2008
    Posts
    13

    Using symbian^3 libraries in QT

    Hi,

    I have a static library 'Testlib.lib' built in symbian^3. Is it possible to link it with a QT application or should I rebuild my [symbian ^3] libraries in QT?

    In my 'TestQT.pro', I have linked it as an external library as:

    symbian: LIBS += -lTestlib

    INCLUDEPATH += $$PWD/../../../Nokia/devices/Nokia_Symbian3_SDK_v1.0/epoc32/release/armv5/urel
    DEPENDPATH += $$PWD/../../../Nokia/devices/Nokia_Symbian3_SDK_v1.0/epoc32/release/armv5/urel

    And I get the following error:
    target : epoc32\release\armv5\udeb\TestQT.exe [arm.v5.udeb.gcce4_4_1]
    arm-none-symbianelf-g++.exe: C:/QtSDK/Symbian/SDKs/Symbian3Qt473/epoc32/release/armv5/lib/Testlib.dso: No such file or directory

    Thanks.

  2. #2
    Super Contributor
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: Using symbian^3 libraries in QT

    Yes, it is possible to link Symbian libraries in Qt.

  3. #3
    Registered User
    Join Date
    Nov 2008
    Posts
    13

    Re: Using symbian^3 libraries in QT

    But how do I solve this error:
    target : epoc32\release\armv5\udeb\TestQT.exe [arm.v5.udeb.gcce4_4_1]
    arm-none-symbianelf-g++.exe: C:/QtSDK/Symbian/SDKs/Symbian3Qt473/epoc32/release/armv5/lib/Testlib.dso: No such file or directory

    I am a newbie to QT an am trying to link my symbian^3 libs to QT.

    Thanks.

  4. #4
    Super Contributor
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: Using symbian^3 libraries in QT

    Add library (Testlib) in .pro file.

    Like
    Code:
    LIBS += -lTestlib
    And check that library is present in your epoc32 or not.

  5. #5
    Registered User
    Join Date
    Nov 2008
    Posts
    13

    Re: Using symbian^3 libraries in QT

    Hi,

    The library was in symbian3's epoc32 and I gave the path to the library as:
    INCLUDEPATH += $$PWD/../../../Nokia/devices/Nokia_Symbian3_SDK_v1.0/epoc32/release/armv5/urel
    DEPENDPATH += $$PWD/../../../Nokia/devices/Nokia_Symbian3_SDK_v1.0/epoc32/release/armv5/urel
    and it complained Testlib.dso file was not found in Symbian3Qt473/epoc32/release/armv5/lib

    I thought it is enough to give the path to the external libraries where it is present. Or should I copy it to the QT's epoc32. Please advice.

    Now, I have removed the INCLUDEPATH and DEPENDPATH and have copied it to QT's epoc32. But now I am getting:
    checklib: error: library C:/QtSDK/Symbian/SDKs/Symbian3Qt473/epoc32/release/armv5/urel/Testlib.lib is incompatible with standard C++.

    I tried setting run_checklib = 0 in cl_bpabi.pm and cl_codewarrior.pm under \epoc32\tools

    but still the problem occurs - 'incompatible with standard C++'

    Thanks.

  6. #6
    Regular Contributor
    Join Date
    Oct 2008
    Location
    Oslo, Norway
    Posts
    329

    Re: Using symbian^3 libraries in QT

    For static libraries, /epoc32/release/armv5/urel (or udeb) is the correct location. There's no need to modify dependpath or any other settings, symbian build tools know where to look for the static libs.

    Try specifying the '.lib' extension for the library:

    Code:
    LIBS += -lTestlib.lib
    This instructs qmake to generate a 'STATICLIB Testlib.lib' statement in the Symbian .mmp.

  7. #7
    Registered User
    Join Date
    Nov 2008
    Posts
    13

    Re: Using symbian^3 libraries in QT

    I have a static library built in symbian^3 and it is linked with a QT application. In the library, when I try to modify a string which is passed by reference, it is crashing.

    TestString::Upper is the static function in Symbian^3 library.

    Code:
    void TestString::Upper(std::string &str)
    {
        // int len = str.length(); // works
    	
        std::transform(str.begin(), str.end(), str.begin(), toupper); // crashes
    	
        // str = "symbian qt";  // crashes
    }
    In QT, on the click event of a button, I have:

    Code:
    void MainWindow::on_pushButton_clicked()
    {
        std::string str = std::string("symbian");
        TestString::Upper(str);
       
        QString a = QString(str.c_str());
        QLabel *label = new QLabel(a, 0);
        label->show();
    }
    When I try to modify the string, it crashes, saying:
    Thread has crashed: A data abort exception has occurred accessing 0x616d6164.

    But if the same function is built as a static library in QT, it is working.

  8. #8
    Registered User
    Join Date
    Nov 2008
    Posts
    13

    Re: Using symbian^3 libraries in QT

    It was my mistake. QT app was using stlportv5 and I had built the symbian^3 library using stlportv4. After changing that it worked.

Similar Threads

  1. Calling Symbian Libraries from Non-Symbian Code
    By NavaronSoftware in forum Symbian
    Replies: 0
    Last Post: 2004-04-28, 10:41
  2. WebSites with open-source symbian libraries? (CPAN for Symbian?)
    By nawkboy in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2003-02-07, 16:29
  3. Replies: 1
    Last Post: 2003-02-07, 16:13

Posting Permissions

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