2013-09-27 46 views
0

我試圖構建一個由3個vc項目文件組成的C++解決方案。在哪裏我正在使用我自己的stl庫和標準stl集合[列表,向量..等]前綴有適當的名稱空間。僅在發佈模式下編譯錯誤 - stl向量

對於一個特定變量[用戶定義類型的向量]。 這是一些用戶自定義的結構這是給一個錯誤的元件:

error C2039: '_Mycont' : is not a member of 'std::_Vector_const_iterator<_Ty,_Alloc>' C:\Program Files\Microsoft Visual Studio 8\VC\include\vector 195 

error C2039: '_Mycont' : is not a member of 'std::_Vector_const_iterator<_Ty,_Alloc>' C:\Program Files\Microsoft Visual Studio 8\VC\include\vector 195 

error C2039: '_Mycont' : is not a member of 'std::_Vector_const_iterator<_Ty,_Alloc>' C:\Program Files\Microsoft Visual Studio 8\VC\include\vector 195 

和該行代碼是

std::vector<ACand> Cands; 

對於上述可變正嘗試執行最少的操作狀插入和刪除。

它在調試模式下正常工作。 無法在發佈模式下執行相同操作。

任何人都可以幫助我解決錯誤。

感謝 拉達

回答

1

你不應該試圖創建自己的STL容器。由你的編譯器實現提供的方式比你可能實現的任何方式都要好。 但是,如果你仍然想這樣做,用適當的名稱空間(如mystd或其他)作爲前綴。我的猜測是,不知何故在發佈,你的程序試圖使用std :: vector而不是mystd :: vector,所以它抱怨,因爲std :: vector不包含任何_Mycont成員。

+0

感謝您的回覆。我已經檢查完整的代碼,沒有任何與標準STL相關的語句是mystl被錯誤地添加了前綴。 – Radha

相關問題