1. 程式人生 > >VS2015除錯問題收集及解決

VS2015除錯問題收集及解決

1.**錯誤**:“MFC internal error: unable to load error string from resource.”

使用ODBC方式訪問資料庫,讀寫方式出錯

1).開啟表的記錄後,對錶執行了edit()但是沒有進行update();

有可能在對記錄判斷執行結果時呼叫了函式,而函式中的return導致跳出了當前記錄錄取,從而跳過了update。當然也有可能是大意少些一個update()。

2).開啟表的記錄後,沒有進行edit或者add的操作,只有讀資料的操作,但對資料操作時依然先寫edit(),讀完後update()

2.**資料庫更新或者刪除失敗**

同樣使用ODBC方式訪問資料庫,開啟表的記錄後,對錶執行了edit()但是沒有進行update();

3.編譯警告**warning MSB8028: The intermediate directory (Release\) contains files shared from another project(專案名.vcxproj). This can lead to incorrect clean and rebuild behavior.**

其中也有可能存在於(Debug\)檔案下

warning MSB8028: The intermediate directory (Debug) contains files shared from an...

提示的含義:在 專案名中的Debug目錄下有另一個專案共享檔案

此時刪除專案檔案加中專案名檔案下的對應debug或者release資料夾,rebuild即可。

例如:專案名為TVAS,報警內容為The intermediate directory (Release\) contains files shared from another project(TVAS.vcxproj). This can lead to incorrect clean and rebuild behavior.

此時找到專案資料夾,開啟專案資料夾中的TVAS資料夾,刪除裡面的release資料夾,而不是專案資料夾立馬能看到的release資料夾,這個資料夾刪了沒有用的。

4.在release模式下修改程式後,發現程式邏輯沒有問題,執行卻出現問題,例如if(a>b){c=a;},但是執行的時候發現a=1,b=2時仍然執行到了{c=1;}

此時轉換到debug模式下編譯即可恢復,同時刪除專案資料夾內專案檔名下的release檔案後重新編譯檔案即可。