在Visual Studio Express 2010
中,我通常只能建立一個程序,然後進行任何更改,我必須將我的代碼粘貼到一個新項目中。它會說構建是成功的,但後來我試着運行它,並得到一個錯誤消息說,是什麼導致MS Visual Studio無法識別構建錯誤?
「這個項目已過時 - 你想建立它嗎?
我點擊是,然後我收到另一個錯誤消息,說有構建錯誤,我必須從上一次成功構建繼續。 有時而不是運行一次成功構建,我得到一個錯誤信息說,
「無法打開[目錄下的程序。系統找不到指定的文件 。」
因爲這個原因,我通常使用Visual Express 2012
,但即使這樣,它偶爾會發生,看似隨意。一旦問題開始,沒有明顯的方法來解決它(重建和重新啓動Visual Studio都有相同的結果)。在Visual Studio Pro 2012
這似乎也發生。
編輯:這是一個在我(2010年版)
1>------ Build started: Project: Lab01, Configuration: Debug Win32 ------
1> Lab01.cpp
1>c:\program files (x86)\reference assemblies\microsoft\framework\.netframework\v4.0\system.core.dll : warning C4945: 'ExtensionAttribute' : cannot import symbol from 'c:\program files (x86)\reference assemblies\microsoft\framework\.netframework\v4.0\system.core.dll': as 'System::Runtime::CompilerServices::ExtensionAttribute' has already been imported from another assembly 'mscorlib'
1> c:\windows\microsoft.net\framework\v4.0.30319\mscorlib.dll : see declaration of 'System::Runtime::CompilerServices::ExtensionAttribute'
1> first seen type is used; re-order imported assemblies to use the current type
1> This diagnostic occurred while importing type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
1>Lab01.cpp(28): error C2664: 'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::get(_Elem &)' : cannot convert parameter 1 from 'char [101]' to 'char &'
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>
1> ]
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
前面的輸出框我猜它說的錯誤在那裏,但它告訴我「構建成功」出於某種原因。 ..
我想到的兩件事:1 - 你有寫作權限的項目和目錄你試圖使用? 2 - 您是否在使用CMake在VS中構建項目? –
問題是什麼? – egur
'從最後一次成功構建'繼續 - 錯誤出現在「視圖 - >錯誤列表」中? (或者他們不?)另外,我假設你在運行之前打「build」並在運行之前檢查錯誤列表?「重建」必須提供比「項目已過期」更多的其他錯誤。在構建它更詳細的內容後,還要檢查'Output'窗口。 – 2014-01-09 14:39:01