在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