C 定義乙個類會遇到的一些問題

2021-06-08 15:47:34 字數 735 閱讀 4406

1.  warning c4627: '#include "***.h"': skipped when looking for precompiled header use

add directive to 'stdafx.h' or rebuild precompiled header

原因:cpp 檔案沒有包含'stdafx.h' 

解決方案: 在標頭檔案加入'stdafx.h' 

2.error c2248: 'cobject::operator =' : cannot access private member declared in class 'cobject' 

解決方案:

3.cpp.cpp(18) : fatal error c1071: unexpected end of file found in comment

解決方案: 刪除檔案最後注釋,並空一行

4.unresolved external symbol "public: virtual struct cruntimeclass *

原因: 你在標頭檔案使用巨集declare_dynamic(youclass) ,但是在cpp 檔案沒有加上 implement_dynamic(cyourclass, cbaseclass) 

解決方案:在cpp 檔案加上

implement_dynamic(cyourclass, cbaseclass)  或者刪除標頭檔案declare_dynamic(youclass)

linux 部署專案會遇到的一些問題

sudo nano etc default locale lang en us.utf 8 language en us en reboot 如果系統沒有裝en us en,執行 sudo locale gen en us.utf 8 vi etc passwd 找到該使用者,修改其shell為ba...

遇到的一些問題心得

一.專案的版本管理。1 gnu 風格的版本號命名格式 主版本號 子版本號 修正版本號 編譯版本號 major version number.minor version number revision number build number 示例 1.2.1,2.0,5.0.0 build 13124...

ubantu遇到的一些問題

給hackywit可以通過sudo提公升root許可權 hackywit cxb hostname cxbhackywit cxb sudo vim etc hosts sudo hackywit 的密碼 127.0.0.1 localhost cxbhackywit cxb sudo apt ge...