我有上面的错误,并遵循所有的解决方案,但没有修复。
这是我的stdafx.h文件。我将其放在目标目录中,我可以看到该文件,完整路径将转到该目录。此外,我还创建了一个win32项目。为什么我的代码不能工作?
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
#include "targetver.h"
#include <stdio.h>
#include <tchar.h>
// TODO: reference additional headers your program requires here实际代码:
// ConsoleApplication1.cpp : Defines the entry point for the console application. //
#include "stdafx.h"
#include <iostream>
int main() { std::cout << "Hello world!" << std::endl; return 0; }发布于 2018-08-01 13:40:46
需要指出的是,在Windows10中使用git从Ubuntu shell克隆存储库时,我遇到了这个问题。
在我使用Windows shell中的git将存储库克隆到不同的位置后,问题消失了,解决方案构建得很好。
问题是构建脚本在大写名称(C:\GIT\LIBRARYX\SRC\)的文件夹中查找'stdafx.cpp‘,如果使用Ubuntu bash中的git克隆解决方案,则此路径不起作用。
https://stackoverflow.com/questions/41044510
复制相似问题