Visual Studio 2013 C ++无法编译更改 [英] Visual Studio 2013 C++ not compiling changes

查看:107
本文介绍了Visual Studio 2013 C ++无法编译更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于我的教授希望在课堂上使用这种环境,所以我想尝试一下视觉工作室。
我创建了一个简单的 Hello World!使VS为我工作的项目。直到最近一切都很好。每当我告诉VS编译并运行我的代码时,它都将运行该程序,但它仅运行该程序的初始版本,而忽略了我所做的任何更改。
我尝试重建解决方案,进行构建,确保将其设置为始终在运行时构建,并且在运行时正在构建正确的解决方案。
我也尝试过保存文件,关闭VS,重新加载VS和编译,但是遇到了同样的问题。
我在某处读到了时间戳可能是个问题。我不知道在哪里可以找到时间戳,并确保它们与当前时间对齐。

I'm trying to get a feel for visual studio, due to my professor wishes to use this environment for class. I've created a simple "Hello World!" project to make VS work for me. Everything worked just fine until recently. Whenever I tell VS to compile and run my code, it will run the program, but it simply runs the initial version of the program, leaving out any changes I have made. I've tried rebuilding the solution, building it, made sure it is set to always build on run, and the correct solutions are building when running. I've also tried saving the file, closing VS, reloading VS, and compiling, but just came across the same issue. I read somewhere how this might be an issue with a timestamp. I don't know where to find the timestamps and make sure they are lined up with the current time.

对此的任何帮助都很棒。

Any help on this would be awesome.

这是我的代码:

#include <iostream>
#include <string>

using namespace std;

int main() {
    // Opens the command prompt and displays the phrase to the user.
    cout << "Hello World! This is a test to see if updates work." << endl;
    /* Pauses the command prompt to allow the user to see what is
    displayed inside of the window. * */
    string tempString = "Press enter to continue.";
    cout << temptString << endl;
    cin >> tempString;
    cout << tempString << endl;

    return 0;
}

编辑:
我也找到了的位置。 VS正在运行的exe文件,并在运行代码之前将其删除。这也无济于事。

I've also found the location of the .exe file which VS is running and deleted it before running the code. This also did not help.

推荐答案

从其他位置加载了文件,并且可以正常工作。我的猜测是我正在尝试编辑文件的只读版本,而不是实际源。

Loaded the file from a different location and it worked. My guess is I was trying to edit a read only version of the file rather than the actual source.

感谢帮助人员!

这篇关于Visual Studio 2013 C ++无法编译更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆