UI中的菜单代码:
- C/C++ code
void CTransferSMSAppUi::HandleCommandL(TInt aCommand) { switch( aCommand ) { case EEikCmdExit: case EAknSoftkeyExit: Exit(); break; case ETransferSmsCommand1: { iSmsEngine->SocketListen(); } break; case EAdd: { form = CDialogContactForm::NewL(); //添加以后提示错误 form->ExecuteLD(R_CONTACTFORM_DIALOG); } case EDelete: { //删除联系人 } case EAbout: { } break; default: Panic( ETransferSMSUi ); break; } }
RSS中的定义
RESOURCE DIALOG r_contactform_dialog
{
flags = EEikDialogFlagNoDrag | EEikDialogFlagFillAppClientRect | EEikDialogFlagWait | EEikDialogFlagCbaButtons;
buttons = R_AVKON_SOFTKEYS_OPTIONS_BACK;
form = r_contact_form;
}
提示错误:总共33个T^T
Creation Time Description Resource Path Location Type
1305357005801 Undefined symbol: 'void CEikMenuPane::AddMenuItemsL(int, int, int) (?AddMenuItemsL@CEikMenuPane@@QAEXHHH@Z)' TransferSMS Unknown C/C++ Problem
1305357005802 Undefined symbol: 'void CEikDialog::PreLayoutDynInitL(void) (?PreLayoutDynInitL@CEikDialog@@MAEXXZ)' TransferSMS Unknown C/C++ Problem
1305357005803 Undefined symbol: 'class CCoeControl * CEikDialog::Control(int) const (?Control@CEikDialog@@QBEPAVCCoeControl@@H@Z)' TransferSMS Unknown C/C++ Problem
1305357005804 Undefined symbol: 'void CEikEdwin::SetTextL(class TDesC16 const *) (?SetTextL@CEikEdwin@@QAEXPBVTDesC16@@@Z)' TransferSMS Unknown C/C++ Problem
1305357005805 Undefined symbol: 'class CCoeControl * CEikDialog::ControlOrNull(int) const (?ControlOrNull@CEikDialog@@QBEPAVCCoeControl@@H@Z)' TransferSMS Unknown C/C++ Problem
1305357005806 Undefined symbol: 'void CEikEdwin::GetText(class TDes16 &) const (?GetText@CEikEdwin@@QBEXAAVTDes16@@@Z)' TransferSMS Unknown C/C++ Problem
1305357005807 Undefined symbol: 'void CEikBorderedControl::SetAdjacent(int) (?SetAdjacent@CEikBorderedControl@@UAEXH@Z)' TransferSMS Unknown C/C++ Problem
1305357005808 Undefined symbol: 'int CEikBorderedControl::HasBorder(void) const (?HasBorder@CEikBorderedControl@@UBEHXZ)' TransferSMS Unknown C/C++ Problem
1305357005809 Undefined symbol: 'void CEikDialog::HandleDialogPageEventL(int) (?HandleDialogPageEventL@CEikDialog@@UAEXH@Z)' TransferSMS Unknown C/C++ Problem
哪里错了呢????include???
纠结了一中午了,还是搞不懂哪里错了~~~~T^T
------解决方案--------------------------------------------------------
Hi,
看上去是链接错误,原因是少库了,修正的方法是在.mmp文件里添加库,比如
LIBRARY eikdlg.lib // CEikDialog
其它的控件/库对应关系可以到SDK帮助文档里查,比如:
"CEikBorderedControl ...Link against: ... eikcoctl.lib"
http://library.forum.nokia.com/topic/S60_5th_Edition_Cpp_Developers_Library/GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6/html/classCEikBorderedControl
Regards
Ziteng Chen