Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.
Symbian DEF File
This Symbian C++ build toolchain .def file is used to ensure that DLLs remain binary compatible between releases, by listing the order that the import library must export functions. This article provides a overview of what DEF files are for and how they are used.
Symbian uses link by ordinal instead of link by name, stripping the name from release executables. As a result, in order for DLLs to remain binary compatible between rebuilds, the ordinal position of exported functions needs to remain the same.
Keeping the functions exported in the same place is done using a def file. After building an application for the first time you can call abld freeze to create a DEF file listing the current function order.
The name of the def file associated with your project defaults to <your_projectname>U.DEF and is located in your project’s /BARM (for ARM build targets) or BWINS (for emulator build targets) directory. The "U" stands for Unicode build in your BARM directory. You can specify a new name and location for this file by using the DEFNAME statement in the DLL’s mmp file. Also, nostrictdef can be added to the mmp file to cause the U not to be added to the def file name.
On subsequent rebuilds this DEF file is used to ensure that the same positions are mapped. You are also warned if any exports are not in the DEF file and can re-freeze the def file and add the new (higher numbered) exports.