vc++ include

来源:百度知道 编辑:UC知道 时间:2024/05/24 22:42:45
各路大哥,小弟有一个问题目
在使用vc++的时候,
有时候可以用
#include "hanshu.h"
(hanshu.h 在 hanshu这个文件夹里)
可是有时候却要写成
#include "hanshu/hanshu.h"
这样才行,问这是为什么呀。
我现在没分,请好心人帮忙。
谢谢大家了
问题补充:不写目录的话
E:\imData\0.011\System1\umain.c(1) : fatal error C1083: Cannot open include file: 'os.h': No such file or directory
怎么办啊

看看你的源文件的位置,如果在
hanshu目录下,就直接写#include "hanshu.h"
如果和hanshu在同一目录下,就要写
#include "hanshu/hanshu.h"

你的头文件如果放在编译器指定的目录下就不需要写目录,否则就要。