windows - Visual Studio Code 编译运行时出现问题(路径错误)
问题描述
从今天早上开始,当我回到 C++ 的冷浴中时,我一直对 Visual Studio 代码非常有耐心。虽然一开始看起来不错,但当我尝试整理我的文件时,一切都变成了 S**T。
这是我的情况的描述
我有一个非常简单的乔木
Folder\header\thisHeader.h
Folder\source\thisHeader.cpp
在thisHeader.h文件中,我们可以找到
#include <stdio.h>
#include <iostream>
int somefunction()
{
printf("5 hours later, coffee did not work and hope is looking grim");
return 0;
}
而在thisHeader.cpp文件中,我们有以下内容
#include "F/headers/thisHeader.h"
#include <stdio.h>
#include <iostream>
int main()
{
somefunction();
}
运行这些相当简单的行会给我一个thisHeader.h的路径错误,即使它是所需的路径。我已经尝试将代码运行到一个文件中并且它确实可以编译。我很想得到一些帮助,因为坦率地说,这个问题让我浪费了一天的时间,尽管我确信它的答案非常简单。
我认为构成一些编译威胁的三件事是:
- 我的标题路径
- 我的文件组织(出于一些黑暗的原因?)
- 我该死的智商和生活选择
解决方案
推荐阅读
- javascript - 为什么我不能在 Phaser 3 JS 中绘制矩形?
- javascript - 在 Windows 上设置 npm 时一直卡住
- apache-ranger - 外部用户无法通过 Ranger Admin UI 登录
- linux - 当服务器启动时,客户端应用程序是否可以通过 unix 域套接字知道服务器已启动?
- python - 在python中使用稀疏矩阵时如何避免负值?
- spring-security - SecurityContextHolder 返回错误的用户名
- api - 如何创建 vuejs unsplash 分页?
- php - 如何在 foreach 循环中使用输出缓冲区?
- c# - 我收到此错误 CS1061:“Rigidbody2D”不包含“velociy”的定义
- android - Android 无法从电子邮件意图中恢复