以下几行代码出错:
#include "stdafx.h"
#include <tchar.h>
#include <windows.h>
#include <iostream>
#include <fstream>
#include <mmsystem.h>
using namespace System;
using namespace std;
#pragma comment(lib, "winmm.lib")
int main()
{...
代码假设使用Windows SDK工作,因此我相应地添加了属性页
但是,在Visual Studio 2012中构建时会出现以下错误:
error C1083: Cannot open include file: 'stdafx.h': No such file or directory 4
3 IntelliSense: name must be a namespace name 11
4 IntelliSense: name followed by '::' must be a class or namespace name 140
5 IntelliSense: expression must have class type 140
6 IntelliSense: name followed by '::' must be a class or namespace name 141
9 IntelliSense: identifier "S" is undefined 145
答案 0 :(得分:0)
将stdfx.h保留在项目文件夹之外