×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 23
  1. #1
    Registered User
    Join Date
    Mar 2003
    Location
    Oulu
    Posts
    132

    Symbian^3 and Static Libraries

    Hi,

    I was trying to compile my project for Symbian^3. I'm using a few static libs and those have worked fine with S60 5th edition. The compiling it self seems successful but linking fails.

    At first I got following error:
    checklib: error: couldn't open file.

    for this I found an ugly, error prone, and laborious workaround.


    Then I faced second problem, which I have not managed to overcome. I get another checklib error message.
    checklib: error: library \Nokia\devices\Nokia_Symbian3_SDK_v0.9\epoc32\release\ARMV5\urel\MyLib.lib is incompatible with standard C++.

    It seems that somebody has solved same problem by adding (ELeave) when creating an instance of Symbian class (checklib). However I don't have any Symbian specific code in my lib and it compiles ok for maemo and simulator.

    Are these 'beta' issues for SDK which will be fixed in near future?
    I'm I doing something wrong and is there any way for me to find out what I might be doing wrong?

  2. #2
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    286

    Re: Symbian^3 and Static Libraries

    <evil>What if you remove checklib from build process. does it work then ?
    just create a dummy checklib exe or hack the perl scripts to ignore it. I think there was a flag for that as well..
    IIRC for quick testing you can modify the make file. search for checklib entry.
    </evil>

    Error probably comes from you building Qt application that defines STDCPP and the static lib doesn't.
    Why these errors are there is most likely because most of the people build Symbian^3 stuff with raptor (SBSv2) which AFAIK doesn't call checklib.
    I use Raptor and RVCT and static libraries are getting picked up from correct place , so this is abld + GCCE bug.

    Why do you want static libraries ?

  3. #3
    Registered User
    Join Date
    Mar 2003
    Location
    Oulu
    Posts
    132

    Re: Symbian^3 and Static Libraries

    Quote Originally Posted by jakoskin View Post
    Error probably comes from you building Qt application that defines STDCPP and the static lib doesn't.
    Why these errors are there is most likely because most of the people build Symbian^3 stuff with raptor (SBSv2) which AFAIK doesn't call checklib.
    I use Raptor and RVCT and static libraries are getting picked up from correct place , so this is abld + GCCE bug.

    Why do you want static libraries ?
    Thanks for fast answer.

    All projects exe and libs defines STDCPP.
    I'm using SBSv1 and GCCE. Perhaps I should make the effort and to make SBSv2 running.

    Why libs
    • to share common modules with many projects
    • for making easier to manage modules
    • if monolithic code size and source file count grows enough tool chain can't handle it
    • faster build times


    why libs instead of dll
    • Symbian
    • avoiding confusion with versions. If two applications would be installed in same device which would use different version of same dll.
    • possible problems appear at compiling rather than application just not starting.


    why dll instead of libs
    • ?


    For my projects libs just seem logic, but I'm always keen to know if there would be better way.
    Last edited by Roose; 2010-12-17 at 11:56. Reason: typo

  4. #4
    Registered User
    Join Date
    Mar 2003
    Location
    Germany
    Posts
    200

    Re: Symbian^3 and Static Libraries

    Quote Originally Posted by Roose View Post
    why libs instead of dll
    One more for the list, which in my experience is the most important argument for static libraries:

    In Symbian, a static .lib does not require the library author to make a decision about the capabilities that the library declares, and thus the type of Symbian Signing it will require.

    A DLL, on the other hand, needs to declare as many or more capabilities than the referencing executable, so it may be necessary to send it through expensive Manufacturer Approved signing if you want it to be usable with every possible application.

    Also, a static library does not require a UID of its own, thus making it easier for a 3rd party to embed it into their package for Symbian Signing, without having to resort to nested SIS packages.

  5. #5
    Registered User
    Join Date
    Mar 2003
    Location
    Oulu
    Posts
    132

    Re: Symbian^3 and Static Libraries

    Quote Originally Posted by mgroeber9110 View Post
    One more for the list, which in my experience is the most important argument for static libraries:

    In Symbian, a static .lib does not require the library author to make a decision about the capabilities that the library declares, and thus the type of Symbian Signing it will require.

    A DLL, on the other hand, needs to declare as many or more capabilities than the referencing executable, so it may be necessary to send it through expensive Manufacturer Approved signing if you want it to be usable with every possible application.

    Also, a static library does not require a UID of its own, thus making it easier for a 3rd party to embed it into their package for Symbian Signing, without having to resort to nested SIS packages.
    All true. DLL's with Symbian is looking for trouble. =)

    While looking for solution for my problems it appears that not too many have faced this kind of issues. What kind of conclusions should be made of this?

    - Static libraries are uncommon?
    - Symbian^3 with Qt is uncommon?
    - My problems are uncommon?

  6. #6
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    286

    Re: Symbian^3 and Static Libraries

    DLL doesn't need UID3 , UID3 is meant for apparc file association. All DLLs UID3 can be 0.
    DLL doesn't need to declare more capabilites than owner process unless you plan it to be general purpose (all -tcb).

    avoiding confusion with versions. If two applications would be installed in same device which would use different version of same dll.
    This cannot happen. You cannot install file from a.sisx if it was part of b.sisx already installed on the phone. Only way is to have it as separate embedded sis but then you should be doing version checking and use the latest .
    Windows like DLL hell won't happen on Symbian as all executables can only be in sys/bin so there cannot exist more than one instance of my.dll (if we don't take file shadowing into account).
    If you need several versions of single DLL then you should consider using ECOM API.

    Static library has one huge flaw that is not acceptable in mobile environment: The added memory consumption, both on disk and in executable memory. And that is why they are almost completely missing from Symbian with few exceptions of compiler libraries and execution harnesses.

    Why Roose you don't see this issues is that people who create DLLs don't use GCCE to do it because it is not optimized for the devices. It creates double the code size to RVCT !

  7. #7
    Registered User
    Join Date
    Jun 2005
    Posts
    48

    Re: Symbian^3 and Static Libraries

    I'm using a generic makefile and GCCE to build a part of the binary, because symbian build system can't use pre-compiler correctly. Therefore I really want to use static libraries, and the the checklib isn't really helping me at all. Just get rid of the stupid too like I did http://www.summeli.fi/?p=2171

  8. #8
    Registered User
    Join Date
    Jun 2005
    Posts
    48

    Re: Symbian^3 and Static Libraries

    Quote Originally Posted by jakoskin View Post
    DLL doesn't need UID3 , UID3 is meant for apparc file association. All DLLs UID3 can be 0.
    DLL doesn't need to declare more capabilites than owner process unless you plan it to be general purpose (all -tcb).



    This cannot happen. You cannot install file from a.sisx if it was part of b.sisx already installed on the phone. Only way is to have it as separate embedded sis but then you should be doing version checking and use the latest .
    Windows like DLL hell won't happen on Symbian as all executables can only be in sys/bin so there cannot exist more than one instance of my.dll (if we don't take file shadowing into account).
    If you need several versions of single DLL then you should consider using ECOM API.

    Static library has one huge flaw that is not acceptable in mobile environment: The added memory consumption, both on disk and in executable memory. And that is why they are almost completely missing from Symbian with few exceptions of compiler libraries and execution harnesses.

    Why Roose you don't see this issues is that people who create DLLs don't use GCCE to do it because it is not optimized for the devices. It creates double the code size to RVCT !
    To be hones. I don't really care about the binary size that much. It may have mattered 10 years ago, but now have fast 3G networks, WLAN access etc. It's really not a big deal anymore.

  9. #9
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    286

    Re: Symbian^3 and Static Libraries

    Quote Originally Posted by summeli View Post
    To be hones. I don't really care about the binary size that much. It may have mattered 10 years ago, but now have fast 3G networks, WLAN access etc. It's really not a big deal anymore.
    Depends on what you target to and what you are making. You should know since you create such great stuff
    As said GCCE is not optimized so it will be much slower as well but lets stick to the size for this argument.

    Say if Qt and QtWebkit would have been built using GCCE and not RVCT the download size would be roughly 25MB which isn't too bad though won't fit to N97. Ok just exclude that device and be done with it. Here comes the issue of executable memory (= RAM in most cases).
    Devices that don't have code paging won't be able to load Qt nor QtWebkit built using GCCE because it simply won't fit to RAM if fits won't have any more RAM left for your application. QtWebkit .code size with RVCT now is about 10MB (ARM, 03, Otime), double that and well... you get the point. Another issue comes from large .code is long startup times. Startup time of webkit app is ~3sec from which over 2secs are spent on loading code. If all devices you are going to deploy to support code paging and better yet also data paging then the issue of binary size is becoming less relevant.

    Ofc. not everyone is making huge libraries

    If everything would be made with static libraries code pages couldn't be shared and memory consumption would skyrocket. Having more than one or two apps running that the same time would be really difficult unless a lot of RAM would be added to the devices. Or allow swap files (there is implementation that pretty much does this for code pages, you can read it from "demand-paging" paper if you have copy of Symbian wiki).
    Last edited by jakoskin; 2010-12-31 at 16:24. Reason: left out the main point

  10. #10
    Registered User
    Join Date
    Jun 2005
    Posts
    48

    Re: Symbian^3 and Static Libraries

    I know. It really does make a huge difference in big projects. Luckily we are not all compiling big projects like QWebkit On the other hand I wouldn't pay for RVCT license for a smaller project than that

  11. #11
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    286

    Re: Symbian^3 and Static Libraries

    Quote Originally Posted by summeli View Post
    I know. It really does make a huge difference in big projects. Luckily we are not all compiling big projects like QWebkit On the other hand I wouldn't pay for RVCT license for a smaller project than that
    True I wouldn't either. I'd like to see much more support for GCCE. Now it is in state where the version that comes out with SDKs is from 2005 and the pre-processor that you complained about is from 1998 (cpp.exe). There is newer officially supported version available from Codesourcery http://www.codesourcery.com/sgpp/lit...al/release1258 , but it is not advertised. I've succesfully used the 4.4.1 version for full build (both release and debug) of Qt and QtWebkit so it works (haven't tried 4.5.x yet). You get rid of the abld pre-processor if you swap to raptor but no SDK supports it out of the box :S

    RVCT4.0 for Symbian is free for individuals and companies with less 10 people https://silver.arm.com/. Still it remains proprietary and you won't get source for it, so in that sense GCCE is still better.
    I've tried that too and it is is quite a lot better than the old 2.2 but it has few oddities like stricter symbol visibility... drifting out of topic...

  12. #12
    Registered User
    Join Date
    Mar 2003
    Location
    Oulu
    Posts
    132

    Re: Symbian^3 and Static Libraries

    Thanks for very interesting, rewarding and well informed reply!


    Quote Originally Posted by jakoskin View Post
    DLL doesn't need UID3 , UID3 is meant for apparc file association. All DLLs UID3 can be 0.
    This was news to me.
    And it doesn't cause any problems at signing application?
    Thanks!


    Quote Originally Posted by jakoskin View Post
    DLL doesn't need to declare more capabilites than owner process unless you plan it to be general purpose (all -tcb).
    For mere application developer this isn't quit as simple.

    If one application might need manufacturer approved capabilities, the dll should be all-tcb. But then devcerts should be manufacturer approved and getting manufacturer approved devcert can take weeks.

    For those applications that don't require so critical capabilities such inflexibility is unnecessary.


    Quote Originally Posted by jakoskin View Post
    This cannot happen. You cannot install file from a.sisx if it was part of b.sisx already installed on the phone. Only way is to have it as separate embedded sis but then you should be doing version checking and use the latest .
    Windows like DLL hell won't happen on Symbian as all executables can only be in sys/bin so there cannot exist more than one instance of my.dll (if we don't take file shadowing into account).
    True, and I feel this is another reason to use static libs.

    If dlls would be in embedded sis signing processes would take more time and I would need to worry about those backward/forward compatibility issues.

    If dlls wouldn't be in embeddes sis only one application using that dll could be installed simultaneously.


    Quote Originally Posted by jakoskin View Post
    Static library has one huge flaw that is not acceptable in mobile environment: The added memory consumption, both on disk and in executable memory. And that is why they are almost completely missing from Symbian with few exceptions of compiler libraries and execution harnesses.
    I'm sure this is true when developing platform.
    However when developing thirt party applications things are different (AFAIK).

    Please correct me if I'm wrong. I'm happily wrong for learning.

    Because the nature of my applications are such that only one of them can be running simultaneously only one exe would be using the dll. Therefore dll wouldn't bring any enhancement for memory consumption.

    The mass memory consumption is bigger, but for mere 3th party application developers it really doesn't make any difference, if my application takes 500kb more space from x GB memory card. I know this was a factor when 64MB memory card costed a fortune.

  13. #13
    Registered User
    Join Date
    Mar 2003
    Location
    Oulu
    Posts
    132

    Re: Symbian^3 and Static Libraries

    Quote Originally Posted by summeli View Post
    I'm using a generic makefile and GCCE to build a part of the binary, because symbian build system can't use pre-compiler correctly. Therefore I really want to use static libraries, and the the checklib isn't really helping me at all. Just get rid of the stupid too like I did http://www.summeli.fi/?p=2171
    Thanks!
    I think I must try this

  14. #14
    Registered User
    Join Date
    Mar 2003
    Location
    Oulu
    Posts
    132

    Re: Symbian^3 and Static Libraries

    Quote Originally Posted by jakoskin View Post
    RVCT4.0 for Symbian is free for individuals and companies with less 10 people https://silver.arm.com/. Still it remains proprietary and you won't get source for it, so in that sense GCCE is still better.
    I've tried that too and it is is quite a lot better than the old 2.2 but it has few oddities like stricter symbol visibility... drifting out of topic...
    Drifting is a happy thing =)

    Does the RVCT have better runtime performance or is it just code size optimization?

    If the runtime performance is better, which kind of differences we are talking about?

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

    Re: Symbian^3 and Static Libraries

    Checklib is there to help you to avoid an unpleasant problem and disabling it just means that you are opening your program to that problem.

    STDCPP's idea of how malloc() works follows the C++ standard: if malloc fails then an exception is raised. Symbian C++'s malloc() returns 0 if allocation fails and there is no exception. malloc() is use whenever you create an instance of a class.

    If you mix libraries with programs that use non-matching malloc() implementations then a lot of bad stuff can happen when the system is low on memory. e.g. an exception being thrown that isn't caught (symbian program, STDCPP static library) or a program that tries to use a NULL pointer (STDCPP program, symbian static library).

    I can get Stefan K. to respond with a better explanation since he wrote it. I am sorry that the raptor team have not been answering any questions here - there are so many places to talk about these things and we were using the Symbian Foundation until it disappeared.

    Cheers,

    TimM

Similar Threads

  1. Static libraries and resources
    By Kirinyale in forum Symbian
    Replies: 6
    Last Post: 2008-10-06, 10:44
  2. Multiple STATIC LIBRARIES ERROR
    By rafamaya in forum Symbian Tools & SDKs
    Replies: 11
    Last Post: 2008-02-12, 09:19
  3. Replies: 5
    Last Post: 2007-10-20, 05:42
  4. WSD in Static libraries..
    By mayankkedia in forum Symbian
    Replies: 4
    Last Post: 2007-04-13, 10:07
  5. Hot to create static libraries
    By Segev in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2007-03-19, 18:56

Posting Permissions

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