×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Mar 2007
    Posts
    56

    Problem with static data in static library compiled by Armv5

    I need to use static data in my static library. And all works fine when I use gcce compiler. But if I use armv5 compiler my static variables don't initialize properly. For example:
    Code:
    class Test
    {
    public:
        int _a;
        Test():
            _a(20) {}
    };
    
    static Test TEST;
    
    TInt DummyFunction()
    {
        return TEST._a;
    }
    In this piece of code constructor isn't called and DummyFunction() returns 0.

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,734

    Re: Problem with static data in static library compiled by Armv5

    Does "static library" refer to a .lib project or to a static interface .dll? In the latter case make sure that you use EPOCALLOWDLLDATA in the .mmp.

  3. #3
    Registered User
    Join Date
    Mar 2007
    Posts
    56

    Re: Problem with static data in static library compiled by Armv5

    "static library" refers to a .lib project

  4. #4
    Registered User
    Join Date
    Apr 2008
    Posts
    2

    Re: Problem with static data in static library compiled by Armv5

    I met same problem. if the static variable in static library initialized with simple data type, it's ok, but if initialized with memory allocation, it failed.
    static Tint x = 1; // that's ok, x will be 1
    static char* y = new char[10]; // that failed, y will be 0
    Last edited by njuzx; 2009-12-11 at 05:31.

Similar Threads

  1. Replies: 6
    Last Post: 2009-02-11, 21:50
  2. Nokia 6600 Socket Server send delay Problem
    By dicson_hu in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2005-10-31, 07:37
  3. Can’t launch application on 6630
    By kaffemannen in forum Symbian
    Replies: 8
    Last Post: 2005-06-29, 10:49
  4. Replies: 0
    Last Post: 2002-12-04, 15:46

Posting Permissions

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