Symbian Def Files: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
=Symbian Def Files=
[[Category:Developing_Qt::Symbian]]
 
= Symbian Def Files =


This documentation is targeted at contributors to Qt.
This documentation is targeted at contributors to Qt.
Line 5: Line 7:
The Symbian toolchains require the list of exported symbols in shared libraries to be maintained explicitly in '''.def''' files.
The Symbian toolchains require the list of exported symbols in shared libraries to be maintained explicitly in '''.def''' files.


For Qt, these files are maintained alongside the Qt source code, under <code>src/s60installs/eabi</code> (<span class="caps">ARM</span>) and <code>src/s60installs/bwins</code> (emulator).
For Qt, these files are maintained alongside the Qt source code, under &lt;code&amp;gt;src/s60installs/eabi&amp;lt;/code&amp;gt; (ARM) and &lt;code&amp;gt;src/s60installs/bwins&amp;lt;/code&amp;gt; (emulator).


If you add or remove public functions to Qt without updating these .def files, '''you will break the compilation''' of Qt for Symbian.
If you add or remove public functions to Qt without updating these .def files, '''you will break the compilation''' of Qt for Symbian.


More information: [http://www.symlab.org/wiki/index.php/Exports_and_Freezing_in_the_Build Exports and Freezing in the Build] ''[symlab.org]''
More information: &quot;Exports and Freezing in the Build&amp;quot;:http://www.symlab.org/wiki/index.php/Exports_and_Freezing_in_the_Build


==Diagnosing .def file errors==
== Diagnosing .def file errors ==


(note: .def files apply to all supported Symbian versions, but the commands mentioned in this section only work when using the Raptor build system).
(note: .def files apply to all supported Symbian versions, but the commands mentioned in this section only work when using the Raptor build system).


If you add an exported function, but don’t add it to the def file, then it won’t appear in the import library.
If you add an exported function, but don't add it to the def file, then it won't appear in the import library.<br />* '''Usual symptom''': link error in the application / higher level dll that uses the new function<br />* '''Diagnostic''': warnings about unfrozen exports when building the dll<br />* '''Solution''': use the freeze command to add new function to the def file<br /><code>sbs -c armv6_urel -c winscw_urel freeze<code>
 
* '''Usual symptom''': link error in the application / higher level dll that uses the new function
* '''Diagnostic''': warnings about unfrozen exports when building the dll
* '''Solution''': use the freeze command to add new function to the def file<br />
 
If you remove an exported function, but don’t remove it from the def file, then the dll build will fail. (flagged as a potential BC break)
 
* '''Diagnostic''': errors about missing exports when building the dll
* '''Solution''': add the <span class="caps">ABSENT</span> keyword to the def file on the functions you removed<br />
 
If you re-add a previously removed function, but don’t update the def file, then it won’t appear in the import library.
 
* '''Usual symptom''': link error in the application / higher level dll that uses the new function
* '''Diagnostic''': warnings about symbols present in <span class="caps">ELF</span> file but absent in <span class="caps">DEF</span> file when building the dll
* '''Solution''': remove the <span class="caps">ABSENT</span> keyword from the def file on the functions you readded<br />   This needs to be done manually


Note: you need to configure '''without''' <code>-developer-build</code> or <code>-nokia-developer</code>, to avoid autotest exports being added to the def files.
If you remove an exported function, but don't remove it from the def file, then the dll build will fail. (flagged as a potential BC break)<br />* '''Diagnostic''': errors about missing exports when building the dll<br />* '''Solution''': add the ABSENT keyword to the def file on the functions you removed<br /></code>sbs -c armv6_urel.remove_freeze -c winscw_urel.remove_freeze freeze</code> Or edit the file manually


===Categories:===
If you re-add a previously removed function, but don't update the def file, then it won't appear in the import library.<br />* '''Usual symptom''': link error in the application / higher level dll that uses the new function<br />* '''Diagnostic''': warnings about symbols present in ELF file but absent in DEF file when building the dll<br />* '''Solution''': remove the ABSENT keyword from the def file on the functions you readded<br />  This needs to be done manually


* [[:Category:Developing Qt|Developing_Qt]]
Note: you need to configure '''without''' &lt;code&amp;gt;-developer-build&amp;lt;/code&amp;gt; or &lt;code&amp;gt;-nokia-developer&amp;lt;/code&amp;gt;, to avoid autotest exports being added to the def files.
** [[:Category:Developing Qt::Symbian|Symbian]]

Revision as of 11:42, 24 February 2015


Symbian Def Files

This documentation is targeted at contributors to Qt.

The Symbian toolchains require the list of exported symbols in shared libraries to be maintained explicitly in .def files.

For Qt, these files are maintained alongside the Qt source code, under <code&gt;src/s60installs/eabi&lt;/code&gt; (ARM) and <code&gt;src/s60installs/bwins&lt;/code&gt; (emulator).

If you add or remove public functions to Qt without updating these .def files, you will break the compilation of Qt for Symbian.

More information: "Exports and Freezing in the Build&quot;:http://www.symlab.org/wiki/index.php/Exports_and_Freezing_in_the_Build

Diagnosing .def file errors

(note: .def files apply to all supported Symbian versions, but the commands mentioned in this section only work when using the Raptor build system).

If you add an exported function, but don't add it to the def file, then it won't appear in the import library.
* Usual symptom: link error in the application / higher level dll that uses the new function
* Diagnostic: warnings about unfrozen exports when building the dll
* Solution: use the freeze command to add new function to the def file

sbs -c armv6_urel -c winscw_urel freeze<code>

If you remove an exported function, but don't remove it from the def file, then the dll build will fail. (flagged as a potential BC break)<br />* '''Diagnostic''': errors about missing exports when building the dll<br />* '''Solution''': add the ABSENT keyword to the def file on the functions you removed<br />

sbs -c armv6_urel.remove_freeze -c winscw_urel.remove_freeze freeze Or edit the file manually

If you re-add a previously removed function, but don't update the def file, then it won't appear in the import library.
* Usual symptom: link error in the application / higher level dll that uses the new function
* Diagnostic: warnings about symbols present in ELF file but absent in DEF file when building the dll
* Solution: remove the ABSENT keyword from the def file on the functions you readded
  This needs to be done manually

Note: you need to configure without <code&gt;-developer-build&lt;/code&gt; or <code&gt;-nokia-developer&lt;/code&gt;, to avoid autotest exports being added to the def files.