×
Namespaces

Variants
Actions

Common build problems in Symbian C++

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
Created: antonypr (25 Jun 2007)
Last edited: hamishwillee (02 Feb 2012)


The following page lists most of the common build problems in Symbian C++. It provides an example of the message as well as provides possible solutions to the problem.

These problems may come when:

  • Building the project using abld command
  • Creating package file using makesis
  • Some other Symbian OS build tools.


Contents

abld.bat: "mwldsym2.exe: Undefined symbol: ..."

Message:

mwldsym2.exe: Undefined symbol: 'int RFs::Connect(int) (?Connect@RFs@@QAEHH@Z)'
mwldsym2.exe: referenced from 'void CHelloWorldBasicAppUi::ConstructL(void) (?Co
nstructL@CHelloWorldBasicAppUi@@UAEXXZ)' in HelloWorldBasicAppUi.cpp:50

Cause:

This error message comes when the code is calling methods from a library, but the library is not declared in the .mmp file.

Another possibility is missing .cpp file in the .mmp file. It happens when the code uses a class or function from a header file; but its .cpp file is not included.

Also a common cause of an undefined symbol error is forward declaring a class and then trying to call one of it's methods.

Solution:

The solution is to include the library (.lib) in the .mmp file. For the message above, the missing library is efsrv.lib

LIBRARY efsrv.lib

Note that Carbide.c++ 1.1 does not use .mmp file to compile the project. To add the library to Carbide.c++ 1.1, right click the project name and select Properties menu. Go to C/C++ Build | Linker | Libraries. Add the library name to the Libraries box.

Carbide.c++ 1.2 uses .mmp to compile the project; so there is no need to modify the Properties dialog.

If the problem is related to missing .cpp file, then the solution is to add the .cpp file to the .mmp file. For example:

SOURCE myfile.cpp

If the problem is related to a forward declared class, replace the forward declaration with the full header for the class.

Replace:

class CMyClass;

with:

#include "MyClass.h"


abld.bat: "undefined identifier ..."

Message:

..\src\HelloWorldBasicAppUi.cpp:82: undefined identifier 'CAknWarningNote'
..\src\HelloWorldBasicAppUi.cpp:86: undefined identifier 'note'

Cause:

This message comes when a code is using a method from a class; but the header file is not included.

Solution:

The solution is to include the necessary header files to the source code. The header file information can be found in the SDK Help. Search the class name or method name in the SDK Help.

For the error message above, the missing header file is aknnotewrappers.h. It can be fixed by adding the following line:

#include <aknnotewrappers.h>


abld.bat: "Can't find following headers in User or System Include Paths"

Message:

WARNING: Can't find following headers in User or System Include Paths 
"HelloWorldBasic.hrh"
(User Inc Paths "\symbian\9.2\s60_3rd_fp1\s60ex\helloworldbasic\data\")
Dependency list for "\Symbian\9.2\S60_3rd_FP1\S60Ex\HelloWorldBasic\data\HelloWo
rldBasic.rss" may be incomplete

Cause:

This message comes when the code includes a header file, but it cannot be found in any of the SYSTEMINCLUDE or USERINCLUDE folders. Although it is a warning, in many cases, it will stop the compilation because the compiler cannot find some header files.

Solution:

The solution is to include the folder of the header file in the .mmp file. For example:

USERINCLUDE ..\inc


abld.bat: "...has initialised data"

Message:

ERROR: Dll '\Symbian\9.2\S60_3rd_FP1\EPOC32\BUILD\Symbian\9.2\S60_3rd_FP1\S60Ex\
Animation\server\group\ANIMATION_SERVER\ARMV5\UREL\Animation_server.dll' has ini
tialised data.

Cause:

This message comes when the compiler finds a global variable in a DLL. On pre-Symbian OS 9, it happens also on application (.app).

Solution:

The solution is to remove the definition of global variable. There are some other more complicated solutions. For more information, please see Writeable static data.


abld.bat: "CreateProcess((null), mwccsym2.exe ... failed"

Message:

process_begin: CreateProcess((null), mwccsym2.exe -g -O0 -inline off -wchar_t of
f -align 4 -warnings on -w nohidevirtual,nounusedexpr -msgstyle gcc -enum int -s
tr pool -exc ms -trigraphs on -nostdinc -d _DEBUG -d _UNICODE -d __SYMBIAN32__ -
d __SERIES60_31__ -d __SERIES60_3X__ -d __CW32__ -d __WINS__ -d __WINSCW__ -d __
EXE__ -d __SUPPORT_CPP_EXCEPTIONS__ -cwd source -i- -i \Symbian\9.2\S60_3rd_FP1\
S60Ex\HelloWorldBasic\inc -i \Symbian\9.2\S60_3rd_FP1\EPOC32\include -i \Symbian
\9.2\S60_3rd_FP1\epoc32\include\variant -i "\Symbian\9.2\S60_3rd_FP1\epoc32\incl
ude\variant\ " -include Symbian_OS_v9.2.hrh -o \Symbian\9.2\S60_3rd_FP1\EPOC32\B
UILD\Symbian\9.2\S60_3rd_FP1\S60Ex\HelloWorldBasic\group\HELLOWORLDBASIC\WINSCW\
UDEB\HelloWorldBasic.o -c \Symbian\9.2\S60_3rd_FP1\S60Ex\HelloWorldBasic\src\Hel
loWorldBasic.cpp, ...) failed.

Cause:

This message comes when abld.bat cannot find the executable of [Nokia_x86_compiler|x86 compiler]. This compiler is shipped with Carbide.c++.

Solution:

The solution is to add the path of the x86 compiler (mwccsym2.exe) into PATH environment variable. This can be done by running a tool, called env_update.exe. For Carbide.c++ 1.2, this tool is located at \carbide\x86Build\env_switch. Run the tool and follow the instruction to setup all the needed environments.

makesis.exe: "error: file I/O fault"

Message:

Processing helloworldbasic_armv5.pkg...
Error : Cannot find file :
..\..\..\epoc32\data\z\resource\apps\HelloWorldBasic.rsc
 
helloworldbasic_armv5.pkg(21) : error: file I/O fault.

Cause:

This message comes when creating a .sis file from the .pkg file. Normally, the cause can be either one of the following:

  • The path of the file is wrong.
  • The file cannot be found by makesis.

Solution:

Open the .pkg file and go to the line that causes the error. Check whether the path is correct. If it is correct, then check whether the file exists in the file system.

devices.exe: "Can´t open perl script"

Message:

C:\devices.exe
Can´t open perl script ¨C:\Program¨: No such file o directory

Cause:

Your Perl does not understand long file names with spaces.

Solution:

Correct your PATH environment variable, make following changes:

  • 'C:\Program Files\Common Files\Symbian\tools' change to 'C:\Progra~1\Common~1\Symbian\tools'
  • 'C:\Program Files\CSL Arm Toolchain\bin' change to 'C:\Progra~\CSLArm~1\bin'

Save this changes and restart your command line prompt.

This page was last modified on 2 February 2012, at 08:28.
52 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×