首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >错误C1083:无法打开源文件:“stdafx.cpp”:没有这样的文件或目录

错误C1083:无法打开源文件:“stdafx.cpp”:没有这样的文件或目录
EN

Stack Overflow用户
提问于 2016-12-09 00:41:40
回答 1查看 3K关注 0票数 4

我有上面的错误,并遵循所有的解决方案,但没有修复。

这是我的stdafx.h文件。我将其放在目标目录中,我可以看到该文件,完整路径将转到该目录。此外,我还创建了一个win32项目。为什么我的代码不能工作?

代码语言:javascript
复制
// 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

实际代码:

代码语言:javascript
复制
// 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; }
EN

回答 1

Stack Overflow用户

发布于 2018-08-01 13:40:46

需要指出的是,在Windows10中使用git从Ubuntu shell克隆存储库时,我遇到了这个问题。

在我使用Windows shell中的git将存储库克隆到不同的位置后,问题消失了,解决方案构建得很好。

问题是构建脚本在大写名称(C:\GIT\LIBRARYX\SRC\)的文件夹中查找'stdafx.cpp‘,如果使用Ubuntu bash中的git克隆解决方案,则此路径不起作用。

票数 7
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41044510

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档