×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Super Contributor
    Join Date
    Mar 2004
    Location
    Bangalore,India
    Posts
    2,146

    WSD in Static libraries..

    I know WSD(Writable Static Data) is an issue with DLL and EXE, and 9.1 onwards WSD is supported for DLL and EXE albiet at programmers descrition. But how about WSD in static libraries, is it allowed/ or is there any issue with WSD with static libraries also?

    Coz when I put static data in my lib, the code compiles fine but i get linking errors saying undefined identifiers. So I am wondering if i am doing something wrong.

    Also for Singleton PAttern Symbian recommends 2 approachs :-

    1) Either use TLS to implement the Singleton class or
    2) Use CCoeStatic to implement a Singleton class.

    http://ncsp.forum.nokia.com/download/?asset_id=12510


    I want to know the pros/cons of both the approaches vis-a-vis the other. And when to use which approach. For instance if I have an exe which links to a static library which in turn links to another static library. And both these static libraries contain singleton classes then which of the above 2 to use and why.

    Also I know DLL's are the recommended way to go forward but what if I still want to use static libraries..then which is better?

    Cheers
    mayank

  2. #2
    Regular Contributor
    Join Date
    Sep 2006
    Location
    Australia, NSW
    Posts
    200

    Re: WSD in Static libraries..

    Static library becomes a part of the executable when you link it, so depens where you link it to. I would go for TLS, because then you could use your lib in both EXE and DLLs without the costs associated with WSD in DLLs.

    One thing to keep in mind is that TLS calls are expensive.

    For CCoeStatic you need to have CONE environment, someone correct me if I'm wrong.

  3. #3
    Registered User
    Join Date
    Aug 2006
    Location
    europe
    Posts
    35

    Re: WSD in Static libraries..

    Well, I used CCoeStatic for my singletons in a DLL that is used by an application. Yes, you need to have a CoeEnv to use CCoeStatic.

    The nice thing with CCoeStatic is that these singletons are fairly easy to use and you rely on an established mechanism.

    Br,
    Frank

  4. #4
    Super Contributor
    Join Date
    Mar 2004
    Location
    Bangalore,India
    Posts
    2,146

    Re: WSD in Static libraries..

    Even I am more inclined towards using a CCoeStatic approach but the only flip side is that when i derive from CCoeStatic my class becomes a C class by default..which I dont really want..as i am not doing any 'C' class kind of functions/operations in my class.

    what r the kind of overheads of TLS?

    Also what about the issue with WSD in Static libraries..any ideas on that?

    Cheers
    mayank

  5. #5
    Regular Contributor
    Join Date
    Oct 2004
    Location
    Tokyo,Japan
    Posts
    289

    Thumbs up Re: WSD in Static libraries..

    TLS is always better,

    for CCoeStatic you are dependednt on CoeEnv that all UI application will have !

    but you can store your singleton object containing your global data on Tls.


    refer to following link for more details

    http://www3.symbian.com/faq.nsf/0/A4...D?OpenDocument

    regards
    nEo

Similar Threads

  1. GoogleIt
    By deepika.mangla in forum Symbian
    Replies: 5
    Last Post: 2011-05-28, 11:04
  2. Python for UIQ
    By cassioli in forum Symbian
    Replies: 141
    Last Post: 2008-06-11, 18:16
  3. Hot to create static libraries
    By Segev in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2007-03-19, 18:56
  4. How to solve this Carbide.c++ link static libraries issue
    By kathyxu123 in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 0
    Last Post: 2006-10-20, 19:23
  5. some problems with label
    By vivienzhung in forum Mobile Java General
    Replies: 1
    Last Post: 2002-10-21, 09:52

Posting Permissions

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