1.No rule to make target `..\gfx\qgn_menu_ .svg', needed by
一般是由於svg檔案路徑變動引起~
開啟.mk檔案修改 ICONDIR=..\Data\gfx,項即可!
2.碰到檔案夾包含等問題,全部在mmp裡修改
============================================================
開此文,不斷收集使用Carbide C++進行symbian開發中遇到的問題及其解決辦法,希望對大家有所協助.
1、Carbide C++匯入工程時出現Invalid project description. overlaps the location of another project錯誤
解決方案:出現這個問題通常是整個工程檔案夾的名字和工程的名字不一樣造成的,修改下就OK了!
2、更新rsc檔案錯誤,我的提示如下Failed to update file \Symbian\9.1\S60_3rd_MR\EPOC32\RELEASE\WINSCW\UDEB\Z\resource\apps\hh_0xEC5F17FD.RSC
解決辦法:這個情況是因為模擬器沒有關,關掉再編譯就OK了。
3、未定義符號錯誤,報錯如下:Undefined symbol: 'void CEikScrollBarFrame::SetScrollBarVisibilityL(enum CEikScrollBarFrame::TScrollBarVisibility, enum CEikScrollBarFrame::TScrollBarVisibility) (?SetScrollBarVisibilityL@CEikScrollBarFrame@@QAEXW4TScrollBarVisibility@1@0@Z)'
解決辦法:造成這個的原因多數是缺少標頭檔或者庫,庫在mmp檔案添加
4、多重定義,報錯如下:Multiply defined symbol: class TUid KExplorerViewId (?KExplorerViewId@@3VTUid@@A) in,這裡是在多視圖中view標頭檔定義view的ID號的錯誤,因為定義時前面少加了const限定符
解決方案:加上const就可以了
5、仍然是多重定義,報錯如下(很多):Multiply defined section: void CPathParser::InitializeDrives(void) (?InitializeDrives@CPathParser@@AAEXXZ) in,這個是因為在mmp檔案中加入了重複的源檔案造成的
解決方案:去mmp檔案修改正確即可
==============================================================
f使用環境:S60 3RD Edition SDK
Carbide.c++ v2.0參考用書:《基於Symbian OS的手機開發與應用實踐》第七章。(這書……,以下所遇到的問題,書中一個答案也找不到,歎~~~)
建立GUI Application。
Q1, 建立的GUI Application 有 Class Application, Document, Ui, View, 並沒有書中所提到的Class Container.A: 因為SDK版本不同,這裡的View由控制項基類Class CCoeControl派生出來,其實就是SDK之前版本的Container。有別於多視圖架構下從Class CAknView派生出來的View。
添加Label
Q2, 加上Label控制項後,編譯Error: Undefined symbol: 'CEikLabel::CEikLabel(void) (??0CEikLabel@@QAE@XZ)'A: 使用控制項得在.mmp檔案中加入LIBRARY eikcoctl.lib
Q3, 編譯成功後,運行程式,控制項卻不顯示。A: 要使用控制項,必須在Class View 中重載函數CountComponentControls() 和 ComponentControl().
加上Editor控制項:在資源檔.rss中定義EDWIN類型的資源RESOURCE EDWIN r_aknexeditor_operatecontainer_edwin,並在Class View的ConstructL()中使用控制項環境Class CCoeEnv 的CreateResourceReaderLC()構造TResourceReader Object; 再使用編輯框Class CEikEdwin的ConstructFromResourceL()函數通過TResourceReader Object建立編輯框。
Q4, 編譯出現Error: illegal use of incomplete struct/union/class 'TResourceReader'A: 在Class AppView.cpp中#include <barsread.h> 並在.mmp檔案中加入LIBRARY bafl.lib
Q5, 解決Q4後,編譯出現Error:undefined identifier 'R_AKNEXEDITOR_OPERATECONTAINER_EDWIN'A: 必須在Class AppView.cpp中#include <***.rsg>
加入ListBox。
Q6, ListBox的垂直捲軸位置並不在ListBox的右邊,而是在螢幕的右上方。A: 單獨設定ListBox之ScrollBar 的位置。 在Class AppView.cpp 之 SizeChanged中加入 CEikScrollBar *vScrollBar = iListBox->ScrollBarFrame()->GetScrollBarHandle(CEikScrollBar::EVertical); vScrollBar->SetExtent(LISTBOX_SB_POS, LISTBOX_SB_SIZE);
Q7, KRgbGreen等在哪定義的?A: 在Carbide中,Ctrl+滑鼠左鍵單擊 即可跳轉到這個宏的定義處。 不過可以自訂色彩object,如下 #define KRgbBack T#3d7bca 重載OfferKeyEventL()函數,處理按鍵事件
Q8, 編譯後在模擬器上運行,跟本就不會運行這個OfferKeyEventL()函數A: 由於沒有把View Object 加入控制項棧,無論怎麼按按鍵,一直都是執行AppUI裡面的HandleKeyEventL(). 在Class AppUi.cpp的ConstructL中用AddToStackL()將View Object加入控制項棧,如下: // Create view object iAppView = CStackAppView::NewL(ClientRect()); AddToStackL(iAppView); 別忘,在解構函式中RemoveFromStack(iAppView); 否則退出程式時會警示CONE 44 Google得:The CONE 44 means ECoePanicControlNotRemovedFromStack.
Q9, 編譯出現Error: Failed to update file ***.RSC
Google得:Usually this would happen if you don't exit the emulator before re-building the resource. Basically emulator will keep the resource file open, so it can not be modified. (關了模擬器就行)ore re-building the resource. Basically emulator will keep the resource file open, so it can not be modified. (關了模擬器就行)
Q10,程式退出出現kern-exec 3錯誤
是因為在appUi解構函式,進行了刪除視圖指標操作,view在加入viewstack後,就不需要手動delete了。系統會自動delete。所以ui的解構函式中去掉delete view的代碼問題就解決了。