C++ 调试会导致许多错误。当我在学校电脑上使用它时,代码运行得很好。但不是在我自己的电脑上

C++ 调试会导致许多错误。当我在学校电脑上使用它时,代码运行得很好。但不是在我自己的电脑上,c++,visual-studio,C++,Visual Studio,我无法从该程序生成可执行文件 我尝试添加Windows universal CRT SDK,或更改Windows SDK,但都不起作用 以下是我得到的错误: variable _ACRTIMP is not a type name The Windows SDK version 10.0.17134.o was not found. Install the requested version of Windows SDK or change the SDK version in the proj

我无法从该程序生成可执行文件

我尝试添加Windows universal CRT SDK,或更改Windows SDK,但都不起作用

以下是我得到的错误:

variable _ACRTIMP is not a type name
The Windows SDK version 10.0.17134.o was not found. Install the requested version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution".
the global scope has no "_Mbstatet"
the global scope has no "Exit"
the global scope has no "wscanf"
the global scope has no "wprintf"
the global scope has no "memset"
下面是代码:

#include "stdafx.h"
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;

int main()
{
    bool      isNew = true,   isNew2 = true, isNew3 = true;
    bool      isAuto = true,   isAuto2 = true, isAuto3 = true;

    //working variables
    float     totalprice = 0.00;
    int       choice = 0;
    bool      isValid = true;

    float     baseprice = 40000.0, baseprice2 = 293200.0, baseprice3 = 35000.0;
    float     taxrate = 1.0875;

    short int year = 2019, year2 = 2019, year3 = 2019;
    int       mileage = 20, mileage2 = 20, mileage3 = 20;

    string    make = "BMW", make2 = "Porsche", make3 = "Ford";
    string    model = "x3", model2 = "911 GT2 RS", model3 = "Mustang";
    string    color = "Red", color2 = "Grey", color3 = "Yellow";
    string    Engine = "v8", engine2 = "liter Boxer", engine3 = "V8";
    string    dname = "Statecars";

    //Display the welcome message
    cout << "Welcome to " << dname << "!" << endl;
    cout << "We sell the following cars! " << endl;
    cout << "1. " << year << " " << color << " " << make << " " << model << endl;
    cout << "2. " << year2 << " " << color2 << " " << make2 << " " << model2 << endl;
    cout << "3. " << year3 << " " << color3 << " " << make3 << " " << model3 << endl;
    cout << "Enter your car choice [1-3]?:  ";
    cin >> choice;

    switch (choice)
    {
    case (1):
        totalprice = baseprice * taxrate;
        break;
    case (2):
        totalprice = baseprice2 * taxrate;
        break;
    case (3):
        totalprice = baseprice3 * taxrate;
        break;
    default:
    {
        isValid = false;
    }
    }

    if (isValid)
    {
        cout << "The total price is: $" << fixed << setprecision(2) << totalprice;
    }
    else
    {
        cout << "invalid choice!" << endl;
    }


    system("pause"); //keep the output screen open

    return 0;
}

找不到Windows SDK版本10.0.17134.0。您应该下载SDK

运行Visual Studio安装程序单击“修改”,然后在安装程序的“各个组件”选项卡中的SDK、库和框架下选择Windows 10 SDK 10.0.17134.0


错误信息非常清楚。如果您有问题,请在您的帖子中提问。作为一个新用户,也可以使用和读取。只有在您尝试修复问题后,我们才能看到错误。你让事情变得更糟了。注意10.0.17134.o是如何拼写错误的,它以字母o而不是数字0结尾。不可能猜到你是怎么做到的,真正的问题是什么,你将不得不再次复制工作机器上的所有东西,这次不要试图修复任何东西。