×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Feb 2011
    Posts
    24

    Deploying Qt app on Symbian with dynamic library

    Hi

    I have some functionality within my app that needs to be deployed as a plugin (it's a QGeoServiceProviderFactory implementation for Qt Mobility).

    However, this plugin will be of no use to any other app.

    Ideally I would build it as a static plugin and build it in to the app, however this is not possible on Symbian.

    How can a plugin that can only be used by my app, be deployed on to an app store?

    Thanks...

  2. #2
    Registered User
    Join Date
    May 2009
    Location
    Greece
    Posts
    191

    Re: Deploying Qt app on Symbian with dynamic library

    You can create separate project for the plugin, which will generate a Dynamic Library. Set the UID of the library with one of the UIDs given to you as a registered developer and add that DLL to your application.

    Here are some info on how to create a DLL:
    http://library.forum.nokia.com/index...EEEFAD43B.html

    And examples: http://library.forum.nokia.com/index...4CC344762.html

    You have 2 options on how to use the generated library:
    1) Integrate the library files in your application by defining the following to your client application's .pro file (definition of capabilities and UID are excluded):
    symbian{
    LIBS += -llibrary_file
    addFiles.sources = $(EPOCROOT)Epoc32/release/$(PLATFORM)/$(CFG)/library_file.dll
    addFiles.path = /sys/bin
    DEPLOYMENT += addFiles
    }


    2) Generate a .sis file containing your library. Then it is separated from the client application and can either be installed separately on the device or can be packed to the client's installation file (sis) as an additional installation file.
    To do this, the .pro file will look like the following (where 0xE0000000 is the UID of your library):
    symbian{
    customrules.pkg_prerules = \
    ";Library_Name" \
    "@\"$(EPOCROOT)Epoc32/InstallToDevice/library_file.sis\",(0xE0000000)"\
    " "
    }


    Any way, these are quick info to get an initial idea. I am sure you will find plenty of info specifying the steps on how to do it.

    I have done both of those options for the implementation of QBluetooth. So if even after checking the examples posted above, something is still vague, i would be glad to help.

  3. #3
    Registered User
    Join Date
    Feb 2011
    Posts
    24

    Re: Deploying Qt app on Symbian with dynamic library

    Favoritas37, many thanks, sounds like you've experienced the same kind of problems I am now! What a man, thanks for the response.

  4. #4
    Nokia Developer Champion
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Deploying Qt app on Symbian with dynamic library

    I think you may be misinterpreting the doc section you quoted. It simply says you can't statically link the Qt SDK libraries into your application. It's certainly possible to create (in a separate project) a static lib that contains a plugin and bind that into your app.

  5. #5
    Registered User
    Join Date
    Feb 2011
    Posts
    24

    Re: Deploying Qt app on Symbian with dynamic library

    I wondered about that. Well, I can't figure out how to do it... bundling the static lib into my app works when building for the Qt Simulator on windows, but I get "recipe linkandpostlink" failures when trying to build for Symbian.

  6. #6
    Registered User
    Join Date
    Feb 2011
    Posts
    24

    Re: Deploying Qt app on Symbian with dynamic library

    @Favoritas37:
    My plugin seems to be generating a DLL file correctly, and I've tried option 1 of the two you've mentioned. It builds OK but when I try to use it at runtime (it loads using QML) the app crashes so I guess it isn't getting bundled in correctly.

    @danhicksbryson above suggests that it should be possible to do what I want with my library as a static plugin too. However that won't build for me as I've mentioned.

    Could you point me to an example of an app and plugin that is configured correctly and I could try building myself? Already sunk quite a lot of time in to this.

    Or if you are familiar with Qt Mobility, maybe a way of doing a custom map tile provider that doesn't involve messing about with plugins?

    Thanks

  7. #7
    Nokia Developer Champion
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Deploying Qt app on Symbian with dynamic library

    Well, remember that you have to build the lib for the target platform.

  8. #8
    Nokia Developer Champion
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Deploying Qt app on Symbian with dynamic library

    Well, here's a pro file from a static lib plugin (don't ask me to explain everything):
    Code:
    # -------------------------------------------------
    # Project created by QtCreator 2010-05-19T10:20:44
    # -------------------------------------------------
    isEmpty(QT_MAJOR_VERSION):VERSION = 4.6.2
    else:VERSION = $${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION}
    QT_INSTALL_LOCATION = C:/QtSymbian/$$VERSION
    TARGET = qsqlcipher
    TARGET = $$qtLibraryTarget($$TARGET)
    TEMPLATE = lib
    CONFIG += qt \
        plugin \
        static
    #CONFIG += debug_and_release
    
    CONFIG += release
    # win32|mac:!wince*:!win32-msvc:!macx-xcode:CONFIG += debug_and_release
    contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
    
    # include(../qt_targets.pri)  # Copyright stuff
    # wince*:LIBS += $$QMAKE_LIBS_GUI
    symbian: { 
        TARGET.EPOCALLOWDLLDATA = 1
        TARGET.CAPABILITY = All \
            -Tcb
        load(armcc_warnings)
    }
    
    # CONFIG(release, debug|release):DEFINES *= NDEBUG
    QT = core \
        sql
    QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/sqldrivers
    target.path += $$[QT_INSTALL_PLUGINS]/sqldrivers
    INSTALLS += target
    
    # Not sure why we need this, but it's standard for SQLite
    DEFINES += QT_NO_CAST_TO_ASCII \
        QT_NO_CAST_FROM_ASCII
    
    # Make .c files compile as .cpp -- needed for crypto.c
    # QMAKE_CXXFLAGS.CW += -lang c++
    # QMAKE_CXXFLAGS.ARMCC += --cpp
    # Unfortunately, breaks other .c files, so need to just rename crypto.c
    # Basic config for encryption, "other" OS, threadsafe, 4-byte malloc alignment
    DEFINES += SQLITE_HAS_CODEC \
        SQLITE_OS_OTHER \
        SQLITE_THREADSAFE \
        SQLITE_4_BYTE_ALIGNED_MALLOC
    
    # The following are standard with QT SQLite builds
    DEFINES += SQLITE_OMIT_LOAD_EXTENSION \
        SQLITE_OMIT_COMPLETE
    
    # These enable debug
    CONFIG(debug, debug|release) { 
        DEFINES += SQLITE_DEBUG \
            SQLITE_MEMDEBUG \
            CODEC_DEBUG
        DEFINES += QVLOG_ENABLE
        message("Debug enabled")
    }
    else { 
        DEFINES += NDEBUG
        message("Release enabled")
    }
    
    # Un-comment to turn off crypto (but go through the motions)
    # DEFINES += CRYPTO_SKIP
    # Un-comment to just turn off the actual crypto operations (for timing)
    # DEFINES += CRYPTO_SKIP2
    # Un-comment to turn on "inversion" and compare of crypto operations
    # DEFINES += CRYPTO_INVERT
    # Un-comment to turn on timing.
    # DEFINES += CRYPTO_TIMING
    SOURCES += qvtimer.cpp \
        qsql_sqlcipher.cpp \
        smain.cpp
    HEADERS += qvtimer.h \
        qsql_sqlcipher.h \
        tsrc/btree.h \
        tsrc/btreeInt.h \
        tsrc/config.h \
        tsrc/crypto.h \ # tsrc/fts1.h \
    # tsrc/fts1_hash.h \
    # tsrc/fts1_tokenizer.h \
    # tsrc/fts2.h \
    # tsrc/fts2_hash.h \
    # tsrc/fts2_tokenizer.h \
    # tsrc/fts3.h \
    # tsrc/fts3Int.h \
    # tsrc/fts3_hash.h \
    # tsrc/fts3_tokenizer.h \
        tsrc/hash.h \
        tsrc/hwtime.h \
        tsrc/keywordhash.h \
        tsrc/mutex.h \
        tsrc/opcodes.h \
        tsrc/os.h \
        tsrc/os_common.h \
        tsrc/pager.h \
        tsrc/parse.h \
        tsrc/pcache.h \
        tsrc/rtree.h \
        tsrc/sqlite3.h \
        tsrc/sqlite3ext.h \
        tsrc/sqliteicu.h \
        tsrc/sqliteInt.h \
        tsrc/sqliteLimit.h \
        tsrc/vdbe.h \
        tsrc/vdbeInt.h \
        cryptoMapper.h \
        qvlog.h
    SOURCES += tsrc/alter.c \
        tsrc/analyze.c \
        tsrc/attach.c \
        tsrc/auth.c \
        tsrc/backup.c \
        tsrc/bitvec.c \
        tsrc/btmutex.c \
        tsrc/btree.c \
        tsrc/build.c \
        tsrc/callback.c \ # tsrc/complete.c \  # Not used with SQLITE_OMIT_COMPLETE
        tsrc/crypto.cpp \ # renamed
        tsrc/date.c \
        tsrc/delete.c \
        tsrc/expr.c \
        tsrc/fault.c \
        tsrc/fkey.c \ # tsrc/fts1.c \
    # tsrc/fts1_hash.c \
    # tsrc/fts1_porter.c \
    # tsrc/fts1_tokenizer1.c \
    # tsrc/fts2.c \
    # tsrc/fts2_hash.c \
    # tsrc/fts2_icu.c \
    # tsrc/fts2_porter.c \
    # tsrc/fts2_tokenizer.c \
    # tsrc/fts2_tokenizer1.c \
    # tsrc/fts3.c \
    # tsrc/fts3_expr.c \
    # tsrc/fts3_hash.c \
    # tsrc/fts3_icu.c \
    # tsrc/fts3_porter.c \
    # tsrc/fts3_snippet.c \
    # tsrc/fts3_tokenizer.c \
    # tsrc/fts3_tokenizer1.c \
    # tsrc/fts3_write.c \
        tsrc/func.c \
        tsrc/global.c \
        tsrc/hash.c \ # tsrc/icu.c \   # Some UTF8 extensions
        tsrc/insert.c \
        tsrc/journal.c \
        tsrc/legacy.c \
        tsrc/loadext.c \
        tsrc/main.c \
        tsrc/malloc.c \ # tsrc/mem0.c \
        tsrc/mem1.c \
        tsrc/mem2.c \ # tsrc/mem3.c \
    # tsrc/mem5.c \
        tsrc/memjournal.c \
        tsrc/mutex.c \ # tsrc/mutex_noop.c \
    # tsrc/mutex_os2.c \
    # tsrc/mutex_unix.c \
    # tsrc/mutex_w32.c \
        mutex_symbian.cpp \
        tsrc/notify.c \
        tsrc/opcodes.c \
        tsrc/os.c \ # tsrc/os_os2.c \
    # tsrc/os_unix.c \
    # tsrc/os_win.c \
        os_symbian.cpp \
        tsrc/pager.c \
        tsrc/parse.c \
        tsrc/pcache.c \
        tsrc/pcache1.c \
        tsrc/pragma.c \
        tsrc/prepare.c \
        tsrc/printf.c \
        tsrc/random.c \
        tsrc/resolve.c \
        tsrc/rowset.c \
        tsrc/rtree.c \
        tsrc/select.c \ # tsrc/shell.c \   # contains main() definition (and unneeded)
        tsrc/status.c \
        tsrc/table.c \ # tsrc/tclsqlite.c \  # Tcl interface
        tsrc/tokenize.c \
        tsrc/trigger.c \
        tsrc/update.c \
        tsrc/utf.c \
        tsrc/util.c \
        tsrc/vacuum.c \
        tsrc/vdbe.c \
        tsrc/vdbeapi.c \
        tsrc/vdbeaux.c \
        tsrc/vdbeblob.c \
        tsrc/vdbemem.c \
        tsrc/vdbetrace.c \
        tsrc/vtab.c \
        tsrc/walker.c \
        tsrc/where.c \
        tsrc/sqliteInt_symbian.c \
        qvlog.cpp

Similar Threads

  1. Deploying with Qt Mobility framework
    By boddison in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 1
    Last Post: 2010-08-20, 10:14

Posting Permissions

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