×

Discussion Board

Results 1 to 15 of 15
  1. #1
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Creating/using a DLL/LIB for Qt Symbian

    Can someone give me a brief guide/sequence for creating and using a relatively simple static DLL? I've found the Symbian docs on this, but they're rather sketchy. I'm reasonably sure I can figure it out, but will have to waste several days on experiments unless I can find a little bit of a "cookbook" or some example.

  2. #2
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Creating/using a DLL/LIB for Qt Symbian

    OK, I've gotten this far:

    Created TestDll project, with TEMPLATE = LIB and MMP_RULES += EXPORTUNFROZEN. Project builds OK.

    Created TestTestDll project, with LIBS += -lTestDll.lib and INCLUDEPATH += c:/symbian/Carbide/workspace/TestDll/. MMP file shows STATICLIBRARY TestDll.lib.

    Project compiles successfully but fails the link with the entry point in the TestDll not found: Undefined symbol: 'TestDll::TestDll(class QWidget *) (??0TestDll@@QAE@PAVQWidget@@@Z)' TestTestDll Unknown C/C++ Problem


    (Both builds are emulator, targeting GCCE.)

    I've verified that TestDll.lib exists, in the same path as qtmain.lib.

    Any ideas as to why it won't link?

  3. #3
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Creating/using a DLL/LIB for Qt Symbian

    I should note that I'm following the Developer's Library instructions for building a static DLL. I think I'd really like to build a static library instead, but I can't see any way to manipulate the PRO file to make it say TARGETTYPE LIB instead of TARGETTYPE DLL.

  4. #4
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Creating/using a DLL/LIB for Qt Symbian

    Adding this mysterious incantation to the first project

    CONFIG += staticlib \
    debug_and_release \
    precompile_header

    causes the MMP to say TARGETTYPE LIB, but the second project still won't build.

  5. #5
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Creating/using a DLL/LIB for Qt Symbian

    Just to bring everything up to a consistent point, here's my first project's PRO:
    Code:
    TEMPLATE = lib
    TARGET = TestDll
    QT += core \
        gui
    HEADERS += TestDll.loc \
        TestDll.h
    SOURCES += TestDll.rss \
        TestDll_reg.rss \
        TestDll.cpp
    FORMS += TestDll.ui
    RESOURCES += 
    symbian:TARGET.UID3 = 0xEE0F3EB9
    MMP_RULES += EXPORTUNFROZEN
    CONFIG += staticlib \
        debug_and_release \
        precompile_header
    Here's the first project's MMP:
    Code:
    // ==============================================================================
    // Generated by qmake (2.01a) (Qt 4.6.0) on: 2010-01-28T21:53:06
    // This file is generated by qmake and should not be modified by the
    // user.
    //  Name        : TestDll.mmp
    // ==============================================================================
    
    TARGET		TestDll.lib
    TARGETTYPE		LIB
    
    UID		0x1000008d 0xEE0F3EB9
    SECUREID		0xEE0F3EB9
    
    EPOCSTACKSIZE		0x14000
    EPOCHEAPSIZE		0x020000 0x800000
    
    
    // Qt Macros
    MACRO		UNICODE
    MACRO		QT_KEYPAD_NAVIGATION
    MACRO		QT_SOFTKEYS_ENABLED
    MACRO		QT_GUI_LIB
    MACRO		QT_CORE_LIB
    
    SYSTEMINCLUDE		../../../../QtSymbian/4.6.0/include/QtCore
    SYSTEMINCLUDE		../../../../QtSymbian/4.6.0/include/QtCore/tmp
    SYSTEMINCLUDE		../../../../QtSymbian/4.6.0/include/QtGui
    SYSTEMINCLUDE		../../../../QtSymbian/4.6.0/include/QtGui/tmp
    SYSTEMINCLUDE		../../../../QtSymbian/4.6.0/include
    SYSTEMINCLUDE		../../../../QtSymbian/4.6.0/include/tmp
    SYSTEMINCLUDE		../../../../QtSymbian/4.6.0/mkspecs/common/symbian
    SYSTEMINCLUDE		../../../../QtSymbian/4.6.0/mkspecs/common/symbian/tmp
    SYSTEMINCLUDE		/epoc32/include
    SYSTEMINCLUDE		.
    SYSTEMINCLUDE		tmp
    SYSTEMINCLUDE		/epoc32/include/stdapis
    SYSTEMINCLUDE		/epoc32/include/stdapis/sys
    SYSTEMINCLUDE		/epoc32/include/stdapis/stlport
    SYSTEMINCLUDE		/epoc32/include/domain/middleware
    SYSTEMINCLUDE		/epoc32/include/domain/middleware/loc
    
    SOURCEPATH 	.
    SOURCE		TestDll.cpp
    SOURCE		moc_TestDll.cpp
    
    
    CAPABILITY		None
    
    OPTION CW -wchar_t on
    OPTION ARMCC --visibility_inlines_hidden --fpu softvfp
    
    VERSION 10.0
    
    PAGED
    Here's the second project's PRO:
    Code:
    TEMPLATE = app
    TARGET = TestTestDll
    QT += core \
        gui
    HEADERS += TestTestDll.h
    SOURCES += TestTestDll_reg.rss \
        main.cpp \
        TestTestDll.cpp
    FORMS += TestTestDll.ui
    RESOURCES += 
    symbian:TARGET.UID3 = 0xE4387496
    INCLUDEPATH += c:/symbian/Carbide/workspace/TestDll/
    LIBS += -lTestDll.lib
    Here's the second project's MMP:
    Code:
    // ==============================================================================
    // Generated by qmake (2.01a) (Qt 4.6.0) on: 2010-01-28T21:53:15
    // This file is generated by qmake and should not be modified by the
    // user.
    //  Name        : TestTestDll.mmp
    // ==============================================================================
    
    TARGET		TestTestDll.exe
    TARGETTYPE		EXE
    
    UID		0x100039CE 0xE4387496
    SECUREID		0xE4387496
    
    EPOCSTACKSIZE		0x14000
    EPOCHEAPSIZE		0x020000 0x800000
    
    SOURCEPATH			. 
    LANG SC 
    START RESOURCE		TestTestDll.rss
    HEADER
    TARGETPATH			/resource/apps
    END
    
    SOURCEPATH			.
    START RESOURCE		TestTestDll_reg.rss
    TARGETPATH		/private/10003a3f/import/apps
    END
    
    
    // Qt Macros
    MACRO		UNICODE
    MACRO		QT_KEYPAD_NAVIGATION
    MACRO		QT_SOFTKEYS_ENABLED
    MACRO		QT_GUI_LIB
    MACRO		QT_CORE_LIB
    
    SYSTEMINCLUDE		../../../../QtSymbian/4.6.0/include/QtCore
    SYSTEMINCLUDE		../../../../QtSymbian/4.6.0/include/QtCore/tmp
    SYSTEMINCLUDE		../../../../QtSymbian/4.6.0/include/QtGui
    SYSTEMINCLUDE		../../../../QtSymbian/4.6.0/include/QtGui/tmp
    SYSTEMINCLUDE		../../../../QtSymbian/4.6.0/include
    SYSTEMINCLUDE		../../../../QtSymbian/4.6.0/include/tmp
    SYSTEMINCLUDE		../../../../QtSymbian/4.6.0/mkspecs/common/symbian
    SYSTEMINCLUDE		../../../../QtSymbian/4.6.0/mkspecs/common/symbian/tmp
    SYSTEMINCLUDE		/epoc32/include
    SYSTEMINCLUDE		.
    SYSTEMINCLUDE		tmp
    SYSTEMINCLUDE		/epoc32/include/stdapis
    SYSTEMINCLUDE		/epoc32/include/stdapis/sys
    SYSTEMINCLUDE		../TestDll
    SYSTEMINCLUDE		../TestDll/tmp
    SYSTEMINCLUDE		/epoc32/include/stdapis/stlport
    SYSTEMINCLUDE		/epoc32/include/domain/middleware
    SYSTEMINCLUDE		/epoc32/include/domain/middleware/loc
    
    SOURCEPATH 	.
    SOURCE		main.cpp
    SOURCE		TestTestDll.cpp
    SOURCE		moc_TestTestDll.cpp
    
    
    STATICLIBRARY	TestDll.lib
    LIBRARY		libstdcpp.lib
    LIBRARY		QtGui.lib
    LIBRARY		QtCore.lib
    LIBRARY		libc.lib
    LIBRARY		libm.lib
    LIBRARY		euser.lib
    LIBRARY		libdl.lib
    STATICLIBRARY	qtmain.lib
    
    CAPABILITY		None
    
    OPTION CW -wchar_t on
    OPTION ARMCC --visibility_inlines_hidden --fpu softvfp
    
    VERSION 10.0
    
    PAGED
    
    OPTION_REPLACE ARMCC --export_all_vtbl // don't use --export_all_vtbl

  6. #6
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Creating/using a DLL/LIB for Qt Symbian

    In my opinion this thread belongs to Qt for Symbian as you are trying to create library for Symbian. Frankly, I don't get what is a target auditory of Qt Tools and SDK's sub-forum. But apart from that I'm pretty sure it should be wiki article about library creation for Symbian as this is pretty basic knowledge.

  7. #7
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Creating/using a DLL/LIB for Qt Symbian

    I looked for a wiki article and only found stuff for Symbian C++. (And if this is "pretty basic" why can't anyone tell me anything?)

  8. #8
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Creating/using a DLL/LIB for Qt Symbian

    Quote Originally Posted by danhicksbyron View Post
    I looked for a wiki article and only found stuff for Symbian C++. (And if this is "pretty basic" why can't anyone tell me anything?)
    I can tell you how to make a library for Linux, if you want

  9. #9
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Creating/using a DLL/LIB for Qt Symbian

    OK, got it working pretty well, at least for the simpler cases.

    To summarize:

    Make the PRO file of your static lib project look about like this:

    Code:
    TARGET = DataEntryWidget
    TEMPLATE = lib
    SOURCES += dataentrywidget.cpp
    HEADERS += dataentrywidget.h
    FORMS += 
    RESOURCES = DataEntryWidget.qrc
    QT += core \
        gui
    MMP_RULES += EXPORTUNFROZEN
    CONFIG += staticlib
    (Not sure whether the EXPORTUNFROZEN is needed above.)

    The resulting MMP file should specify your TARGET as a .lib file.

    In the project that uses the static lib, add the following to your PRO file:

    LIBS += -lDataEntryWidget.lib

    (Note that ".lib" must be appended to the name, unlike the usual case for LIBS. This causes the static library to be listed as a STATICLIBRARY rather than a LIBRARY in the MMP file.)

    INCLUDEPATH += c:/QtProjects/DataEntryWidget (Or wherever the .h files of the library project are)

    If you have any QRC files in the static lib, you need to activate them by using the Q_INIT_RESOURCE macro:

    Q_INIT_RESOURCE(DataEntryWidget);

    Examples show this referenced early in the main method of the user of the library -- not clear that it couldn't be somewhere in the library itself, so long as it's guaranteed to be executed before the resources are needed.

  10. #10
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Creating/using a DLL/LIB for Qt Symbian

    Well, it works for the emulator, but when I try to build the using application the lib file isn't found. Looking back at the build console for the lib, I see this:

    Code:
    ***Invoking abld command
    perl.exe -S ABLD.PL \QtProjects\DataEntryWidget\ target gcce udeb  
      make -r  -f "\S60\devices\S60_5th_Edition_SDK_v1.0\EPOC32\BUILD\QtProjects\DataEntryWidget\GCCE.make" TARGET CFG=UDEB VERBOSE=-s
    make -j 4 -s  -C \QtProjects\DataEntryWidget -f "MAKEFILE_0XECD85E6C.MK" TO_ROOT=..\.. EPOCBLD=\S60\devices\S60_5th_Edition_SDK_v1.0\EPOC32\BUILD\MAKEFILE_0XECD85E6C\GCCE TO_BLDINF=..\..\QtProjects\DataEntryWidget PLATFORM=GCCE CFG=UDEB BLD
    make -j 4 -s  -r -f "\S60\devices\S60_5th_Edition_SDK_v1.0\EPOC32\BUILD\QtProjects\DataEntryWidget\DATAENTRYWIDGET_0XECD85E6C\GCCE\DATAENTRYWIDGET_0XECD85E6C.GCCE" UDEB
    qrc_dataentrywidget.cpp
    Sorry, \epoc32\gcc\bin\ar.exe is not supported in this release. Please use a different
    device. Use 'devices' to view the available devices.
    make[1]: *** [\S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\release\armv5\udeb\DataEntryWidget.lib] Error 2
    make: *** [TARGETDATAENTRYWIDGET_0XECD85E6C] Error 2
    Does anyone have any words of wisdom (or even an amusing insult or two)?

  11. #11
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Creating/using a DLL/LIB for Qt Symbian

    I do find mention of changing a value from

    AR=ar.exe

    to

    AR=arm-none-symbianelf-ar.exe

    But can't find any place where this change might be accomplished.

    There does not seem to be a mention of "ar.exe" anywhere on my system.

    The "AR=arm-none-symbianelf-ar.exe" string is shown on the web as being in a configure.in file, but I can't find that anywhere.

  12. #12
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Creating/using a DLL/LIB for Qt Symbian

    OK, continuing saga:

    ar.exe is found in C:\Program Files (x86)\Common Files\Symbian\tools

    Copy that and "ar.pl" to epoc32\gcc\bin and then I get this error:

    Code:
    Can't locate tlaunch.pm in @INC (@INC contains: C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/gcc/bin C:/Perl/lib C:/Perl/site/lib .) at C:\S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\gcc\bin/ar.pl line 3.
    BEGIN failed--compilation aborted at C:\S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\gcc\bin/ar.pl line 3.
    make[1]: *** [\S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\release\armv5\urel\DataEntryWidget.lib] Error 2
    make: *** [LIBRARYDATAENTRYWIDGET_0XECD85E6C] Error 2
    Copy "tlaunch.pm" between the above two directories and then...

    Code:
    Can't locate CDevicesCLAccessor.pm in @INC (@INC contains: C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/gcc/bin C:/Perl/lib C:/Perl/site/lib .) at C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/gcc/bin/tlaunch.pm line 13.
    BEGIN failed--compilation aborted at C:/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/gcc/bin/tlaunch.pm line 13.
    Compilation failed in require at C:\S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\gcc\bin/ar.pl line 3.
    BEGIN failed--compilation aborted at C:\S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\gcc\bin/ar.pl line 3.
    make[1]: *** [\S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\release\armv5\udeb\DataEntryWidget.lib] Error 2
    make: *** [TARGETDATAENTRYWIDGET_0XECD85E6C] Error 2
    Copy CDevicesCLAccessor.pm and then it can't find CDevices. So copy CDevices.pm and CDevicesFile.pm (after spending a few minutes looking fruitlessly for a way to append to the Perl search path).

    Next it wants XML/DOM.pm from epoc32/gcc/bin\perllib. Create the perllib\XML directory and install dom.pm and regexp.pm from C:\Program Files (x86)\Common Files\Symbian\tools\perllib\xml.

    Now I get this message:

    Code:
    To use new Symbian OS tools specify a default device using devices -setdefault
    (otherwise unset EPOCROOT and specify a device explicitly)
    make[1]: *** [\S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\release\armv5\urel\DataEntryWidget.lib] Error 2
    make: *** [LIBRARYDATAENTRYWIDGET_0XECD85E6C] Error 2

  13. #13
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Creating/using a DLL/LIB for Qt Symbian

    My existing devices setting:

    Code:
    C:\Users\danhicks>devices -default
    Default device: S60_5th_Edition_SDK_v1.0:com.nokia.s60
    C:\Users\danhicks>

  14. #14
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Creating/using a DLL/LIB for Qt Symbian

    The message is coming out of tlaunch.pm.

  15. #15
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Creating/using a DLL/LIB for Qt Symbian

    I reloaded my entire development suite and it started working, without the need to copy any of those Perl files.

Similar Threads

  1. Some questions about general viability of Symbian development
    By dzankizakon in forum General Development Questions
    Replies: 0
    Last Post: 2009-03-12, 00:57
  2. Symbian Signed moved to Symbian Foundation ..
    By kamaljaiswal in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 6
    Last Post: 2009-03-03, 21:35
  3. A little survey regarding Java vs Symbian C++
    By Olnex in forum Mobile Java General
    Replies: 0
    Last Post: 2006-11-01, 09:00
  4. Replies: 2
    Last Post: 2003-08-19, 16:39
  5. setting of Series 60 MIDP SDK for Symbian OS version 1.2 for networking
    By servigo in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2003-07-31, 07:47

Posting Permissions

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