作者热门文章
- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我遇到上述错误并已遵循所有解决方案但没有解决。
这是我的 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; }
最佳答案
郑重声明,我在 Windows 10 的 Ubuntu shell 中使用 git 克隆存储库时遇到了这个问题。
在我从 Windows shell 使用 git 将存储库克隆到其他位置后,问题消失了,解决方案构建正常。
问题是构建脚本正在大写名称 (C:\GIT\LIBRARYX\SRC\
) 的文件夹中寻找“stdafx.cpp”,如果解决方案是使用 git 从 Ubuntu bash 克隆的。
关于c++ - 错误 C1083 : Cannot open source file: "stdafx.cpp' : No such file or directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41044510/
我是一名优秀的程序员,十分优秀!