当前位置:网站首页>#从源头解决# 自定义头文件在VS上出现“无法打开源文件“XX.h“的问题
#从源头解决# 自定义头文件在VS上出现“无法打开源文件“XX.h“的问题
2022-07-05 12:51:00 【全栈程序员站长】
大家好,又见面了,我是你们的朋友全栈君。
自己编写了一个头文件 ,在主函数中通过#include引用时出现了 无法打开源文件的问题,通过网上查阅,大多数人的做法是:右键项目->属性->VC++目录->包含目录->下拉剪头->编辑,在对话框中加入 $(ProjectDir)。
问题完美解决! 但是原理是啥?通过进一步研究,发现问题是自己混淆了 #include”xx.h” 和 #include<xx.h> 的用法,
#include<xx.h> 表示直接从编译器自带的函数库中寻找文件,编译器从标准库路径开始搜索.xxh
include”xx.h” 表示先从自定义的文件中找 ,如果找不到在从函数库中寻找文件,编译器从用户的工作路径开始搜索 xx.h 如果我们通过<>的方式引用自己编写的头文件,必然会出现无法找到与源文件的问题,因为我们的文件放在了用户目录下,上面的解决办法本质上是通过将会用户目录追加到编译器搜索范围内,其实通过将<>换成” “就可以解决问题了。
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/149516.html原文链接:https://javaforall.cn
边栏推荐
- Sorry, we can't open xxxxx Docx, because there is a problem with the content (repackaging problem)
- [cloud native] event publishing and subscription in Nacos -- observer mode
- Yyds dry inventory JS intercept file suffix
- The solution of outputting 64 bits from printf format%lld of cross platform (32bit and 64bit)
- 初次使用腾讯云,解决只能使用webshell连接,不能使用ssh连接。
- Rocky基础知识1
- Install rhel8.2 virtual machine
- MySQL giant pit: update updates should be judged with caution by affecting the number of rows!!!
- Introduction aux contrôles de la page dynamique SAP ui5
- 946. Verify stack sequence
猜你喜欢

Le rapport de recherche sur l'analyse matricielle de la Force des fournisseurs de RPA dans le secteur bancaire chinois en 2022 a été officiellement lancé.

Leetcode20. Valid parentheses

RHCSA10

蜀天梦图×微言科技丨达梦图数据库朋友圈+1

聊聊异步编程的 7 种实现方式

阿里云SLB负载均衡产品基本概念与购买流程

Laravel文档阅读笔记-mews/captcha的使用(验证码功能)

How to realize batch sending when fishing

Discussion on error messages and API versions of SAP ui5 getsaplogonlanguage is not a function

SAP SEGW 事物码里的 ABAP 类型和 EDM 类型映射的一个具体例子
随机推荐
聊聊异步编程的 7 种实现方式
Reverse Polish notation
Research: data security tools cannot resist blackmail software in 60% of cases
精彩速递|腾讯云数据库6月刊
mysql拆分字符串做条件查询
#yyds干货盘点# 解决名企真题:搬圆桌
逆波兰表达式
函数的默认参数&函数参数的多种方法
How to realize batch sending when fishing
DNS的原理介绍
《2022年中国银行业RPA供应商实力矩阵分析》研究报告正式启动
CVPR 2022 | single step 3D target recognizer based on sparse transformer
Principle and configuration of RSTP protocol
Taobao short video, why the worse the effect
国际自动机工程师学会(SAE International)战略投资几何伙伴
Put functions in modules
About the single step debugging of whether SAP ui5 floating footer is displayed or not and the benefits of using SAP ui5
RHCSA4
I'm doing open source in Didi
Halcon 模板匹配实战代码(一)