cos*_*sta 6 c++ visual-studio-2010
经过C++的长时间休息,我试图在VS2010中编译一个非常简单的C++项目.我创建了一个Win32 C++控制台空项目,我选择了没有预编译的头文件而没有其他MS库.我添加了以下main.cpp文件:
#include <iostream>
#include <string>
using namespace std;
class A
{
public:
string name;
};
int main(int argc, char** argv)
{
return 0;
}
Run Code Online (Sandbox Code Playgroud)
当我编译时,我得到臭名昭着的错误:
1>------ Build started: Project: TestGetline, Configuration: Debug Win32 ------
1> main.cpp
1>main.cpp : fatal error C1033: cannot open program database ''
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Run Code Online (Sandbox Code Playgroud)
以下是一些事实:
我使用桌面Parallels运行Windows 7 64位作为VM:版本6.1.7601 Service Pack 1 Build 7601. VM已选中共享配置文件,这意味着文档,下载等文件夹在OSX和Windows 7之间共享.
VS 2010版:Microsoft Visual Studio 2010,版本10.0.40219.1 SP1Rel,Microsoft .NET Framework版本4.0.30319 SP1Rel
我用于启动VS 2010的链接已选中在Windows XP(Service Pack 3)的兼容模式下运行此程序.不检查以管理员身份运行此程序.
我在其他帖子中尝试了一些建议,但没有一个有效.例如,我尝试杀死mspdbsrv.exe(VS 2010已关闭),手动删除调试目录,然后重新编译项目.我试图将调试信息格式更改为C7兼容,但后来又出现了另一个错误(main.cpp:致命错误C1074:'IDB'是PDB文件的非法扩展:).我尝试以管理员身份运行VS 2010,但错误与臭虫一样顽固.是的,在尝试所有这些时,有防病毒运行.
还有其他想法吗?人们不禁要问,在VS 2010中是否有人在进行C++开发.升级到VS 2012或2013目前不是一个选择.
谢谢
只是一个更新,这里是编译日志文件失败的构建任务的输出:
1>Target "ClCompile" in file "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets" from project "C:\projects\cpp\TestGetLine\TestGetline\TestGetline.vcxproj" (target "_ClCompile" depends on it):
Using "Delete" task from assembly "Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "Delete"
Done executing task "Delete".
Task "CL" skipped, due to false condition; ('%(ClCompile.PrecompiledHeader)' == 'Create' and '%(ClCompile.ExcludedFromBuild)'!='true') was evaluated as ('' == 'Create' and ''!='true').
Using "CL" task from assembly "Microsoft.Build.CppTasks.Win32, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "CL"
Forcing recompile of all source files due to missing PDB "Debug\vc100.pdb".
Environment Variables passed to tool:
VS_UNICODE_OUTPUT=1328
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /Zi /nologo /W3 /WX- /Od /Oy- /D WIN32 /D _DEBUG /D _CONSOLE /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Debug\\" /Fd"Debug\vc100.pdb" /Gd /TP /analyze- /errorReport:prompt main.cpp
Tracking command:
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\Tracker.exe /d C:\Windows\Microsoft.NET\Framework\v4.0.30319\FileTracker.dll /i C:\projects\cpp\TestGetLine\TestGetline\Debug /r C:\PROJECTS\CPP\TESTGETLINE\TESTGETLINE\MAIN.CPP /b MSBuildConsole_CancelEvent7f4b09d9e64d472facf5c417755b2cdd /c "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe" /c /Zi /nologo /W3 /WX- /Od /Oy- /D WIN32 /D _DEBUG /D _CONSOLE /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Debug\\" /Fd"Debug\vc100.pdb" /Gd /TP /analyze- /errorReport:prompt main.cpp
main.cpp
1>main.cpp : fatal error C1033: cannot open program database ''
The command exited with code 2.
Done executing task "CL" -- FAILED.
1>Done building target "ClCompile" in project "TestGetline.vcxproj" -- FAILED.
1>Done Building Project "C:\projects\cpp\TestGetLine\TestGetline\TestGetline.vcxproj" (build target(s)) -- FAILED.
Run Code Online (Sandbox Code Playgroud)
小智 11
为了解决这个问题,我删除了pdb文件(在我备份之后),然后构建它.
| 归档时间: |
|
| 查看次数: |
19510 次 |
| 最近记录: |