hi,
when i compiled my file using adld build thumb urel i got error (has initialized data)i don't know what is the reason for this .i have got a warninig exports not yet frozen is this making the error .
ERROR: Dll 'LEVELG[0116C9D3].APP' has initialised data.
please help.............. :frown:
You probably have a global variable somewhere in your code. Although it is allowed to use global constants you cannot use global variables in your Symbian application, since it's essentially a DLL without a data-segment.
Here's an excerpt from the Symbian help file explaining this:
"The Symbian platform is designed for ROM-based computing. A DLL which is resident in ROM cannot be written to. Although DLLs may in some cases be RAM loaded, the Symbian platform makes the conservative assumption that no DLL can be written to. DLLs on the Symbian platform therefore have no data segment. An immediate consequence is that no DLL may contain writeable static data, whether initialised or uninitialised.
Static data is any data declared outside a function, e.g.
TBufC<20> fileName;
void SetFileName()
{
...
}
Many existing programs make extensive use of this kind of data. On the Emulator, which runs under Windows on a PC, this will not necessarily cause problems because DLLs use the underlying Windows DLL mechanisms in which writeable data is allowed. However, any such code will not compile for non-Emulator targets. The build will fail with a warning from the petran tool, which runs as the final stage of the build chain for non-Emulator targets. The message generated by the petran tool looks like:
ERROR: Dll 'MENUITEMS[10008AD0].APP' has uninitialised data.
You must eliminate all writeable static from your DLL in order to avoid this error.
Because in some cases it is useful for DLLs to maintain data, the Symbian platform does provide a mechanism which allows a DLL to manage a small amount of private storage on a per-thread basis, known as thread local storage � see Threads and Processes Overview. A per-thread mechanism is chosen to avoid potential ambiguities which otherwise arise over which of potentially many users of the DLL should see the data. "
Hope this helps.
Best regards
Arjen