• <legend id='wrXO2'><style id='wrXO2'><dir id='wrXO2'><q id='wrXO2'></q></dir></style></legend>

    <tfoot id='wrXO2'></tfoot>

    1. <i id='wrXO2'><tr id='wrXO2'><dt id='wrXO2'><q id='wrXO2'><span id='wrXO2'><b id='wrXO2'><form id='wrXO2'><ins id='wrXO2'></ins><ul id='wrXO2'></ul><sub id='wrXO2'></sub></form><legend id='wrXO2'></legend><bdo id='wrXO2'><pre id='wrXO2'><center id='wrXO2'></center></pre></bdo></b><th id='wrXO2'></th></span></q></dt></tr></i><div id='wrXO2'><tfoot id='wrXO2'></tfoot><dl id='wrXO2'><fieldset id='wrXO2'></fieldset></dl></div>
      1. <small id='wrXO2'></small><noframes id='wrXO2'>

          <bdo id='wrXO2'></bdo><ul id='wrXO2'></ul>

        VS 2010 错误 - 无法打开文件“iostream"

        VS 2010 error - cannot open file quot;iostreamquot;(VS 2010 错误 - 无法打开文件“iostream)
        <i id='HAB1d'><tr id='HAB1d'><dt id='HAB1d'><q id='HAB1d'><span id='HAB1d'><b id='HAB1d'><form id='HAB1d'><ins id='HAB1d'></ins><ul id='HAB1d'></ul><sub id='HAB1d'></sub></form><legend id='HAB1d'></legend><bdo id='HAB1d'><pre id='HAB1d'><center id='HAB1d'></center></pre></bdo></b><th id='HAB1d'></th></span></q></dt></tr></i><div id='HAB1d'><tfoot id='HAB1d'></tfoot><dl id='HAB1d'><fieldset id='HAB1d'></fieldset></dl></div>
          <legend id='HAB1d'><style id='HAB1d'><dir id='HAB1d'><q id='HAB1d'></q></dir></style></legend>

          <tfoot id='HAB1d'></tfoot>
            <bdo id='HAB1d'></bdo><ul id='HAB1d'></ul>
              <tbody id='HAB1d'></tbody>

                • <small id='HAB1d'></small><noframes id='HAB1d'>

                  本文介绍了VS 2010 错误 - 无法打开文件“iostream"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我刚刚从 VS2005 迁移到 VS2010,它无法编译一个简单的程序.

                  I've just migrated from VS2005 to VS2010 and it fails to compile a simple program.

                  #include <iostream>
                  using std::cout;
                  using std::endl;
                  
                  int main()
                  {
                      cout << "Hello Visual Studio 2010 :)" << endl;
                  }
                  

                  错误 -

                  1  error TRK0005: Failed to locate: "CL.exe". The system cannot find the file specified.
                  2  IntelliSense: cannot open source file "iostream"
                  3  IntelliSense: name followed by '::' must be a class or namespace name
                  4  IntelliSense: name followed by '::' must be a class or namespace name
                  5  IntelliSense: identifier "cout" is undefined
                  6  IntelliSense: identifier "endl" is undefined
                  

                  PS:我对使用 VS2010 完全陌生,但有使用 VS 2005 的经验.

                  PS: I'm completely new to using VS2010 but have experience in VS 2005.

                  以下是我从 VS2005 添加到 VS2010 的用户属性表"下的目录列表

                  Here are lists of directories that I added from VS2005 to VS2010 under 'user property sheet'

                  可执行 -

                  $(VCInstallDir)bin; $(VSInstallDir)Common7Toolsin; $(VSInstallDir)Common7	ools; $(VSInstallDir)Common7ide; $(VSInstallDir); $(VSInstallDir)SDKv2.0in
                  

                  包括 -

                  $(VCInstallDir)include; $(VCInstallDir)atlmfcinclude; $(FrameworkSDKDir)include
                  

                  图书馆 -

                  $(VCInstallDir)lib; $(VCInstallDir)atlmfclib; $(VCInstallDir)atlmfclibi386; $(FrameworkSDKDir)lib; $(VSInstallDir); $(VSInstallDir)lib
                  

                  来源 -

                  $(VCInstallDir)atlmfcsrcmfc; $(VCInstallDir)atlmfcsrcmfcm; $(VCInstallDir)atlmfcsrcatl; $(VCInstallDir)crtsrc
                  

                  推荐答案

                  我在几台不同的机器上遇到了同样的问题,这些机器已经安装了其他版本的 VS(2005、2008).我最终也收到了各种奇怪的错误.

                  I've run into the same issue on a couple of different machines where there were other versions of VS (2005, 2008) already installed. I ended up also getting all sorts of strange errors.

                  我发现以下技巧对我有用,也许它也适用于您的情况:- 打开一个新的 VS2010 实例- 使用 def 设置创建新的控制台应用程序.- 尝试编译:应该有一些错误- 打开物业经理"- 调出项目的 Microsoft.Cpp.Win32.user 属性表- 单击 VC++ 目录- 单击可执行目录"字段.那应该显示一个下拉列表,单击下拉列表并选择编辑".您应该会看到一堆继承的值,这些值应该包含与上面列出的目录类似的所有必需目录.取消选中从父级或项目默认值继承"选项.重新检查并单击确定".
                  - 对包含、库目录等重复此操作.- 点击应用"和确定"- 重建项目并检查它是否有效.

                  I found the following trick worked for me, maybe it will work in your case too: - Open a new instance of VS2010 - Create new console application with the def settings. - Try compile: there should be some errors - Open the "Property Manager" - Bring up the Microsoft.Cpp.Win32.user property sheet of the project - Click on VC++ Directories - Click on the "Executable Directories" field. That should display a drop down, click on the drop down and select "Edit". You should see a bunch of inherited values that supposedly contain all the required directories similar to the ones you listed above. Uncheck the "Inherit from parent or project defaults" option. Recheck it and click "Ok".
                  - Repeat this for the includes, library directories, etc. -Click on "Apply" and "Ok" - Rebuild the project and check if this worked.

                  我只需要这样做一次.关闭VS并创建一个新项目后,我就可以编译了.在我发现这一点之前,我手动删除了所有继承的值,并为所有 VS 和 SDK 目录添加了绝对路径.这也有效,但需要做更多的工作.

                  I only needed to do this once. After closing VS and creating a new project, I could just compile. Before I discovered this, I manually removed all inherited values and added absolute paths to all the VS and SDK directories. That also worked, but was a lot more work.

                  这篇关于VS 2010 错误 - 无法打开文件“iostream"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  C++ stl unordered_map implementation, reference validity(C++ stl unordered_map 实现,参考有效性)
                  C++: Is it possible to use a reference as the value in a map?(C++:是否可以使用引用作为映射中的值?)
                  Where ampersand quot;amp;quot; can be put when passing argument by reference?(其中符号“amp;通过引用传递参数时可以放置吗?)
                  Why can a non-const reference parameter be bound to a temporary object?(为什么可以将非常量引用参数绑定到临时对象?)
                  What is a dangling reference?(什么是悬空引用?)
                  C++ reference changes when push_back new element to std::vector(当 push_back 新元素到 std::vector 时,C++ 引用发生变化)
                    • <i id='P2LsB'><tr id='P2LsB'><dt id='P2LsB'><q id='P2LsB'><span id='P2LsB'><b id='P2LsB'><form id='P2LsB'><ins id='P2LsB'></ins><ul id='P2LsB'></ul><sub id='P2LsB'></sub></form><legend id='P2LsB'></legend><bdo id='P2LsB'><pre id='P2LsB'><center id='P2LsB'></center></pre></bdo></b><th id='P2LsB'></th></span></q></dt></tr></i><div id='P2LsB'><tfoot id='P2LsB'></tfoot><dl id='P2LsB'><fieldset id='P2LsB'></fieldset></dl></div>
                    • <small id='P2LsB'></small><noframes id='P2LsB'>

                      <legend id='P2LsB'><style id='P2LsB'><dir id='P2LsB'><q id='P2LsB'></q></dir></style></legend>
                        <bdo id='P2LsB'></bdo><ul id='P2LsB'></ul>
                      • <tfoot id='P2LsB'></tfoot>

                            <tbody id='P2LsB'></tbody>