C中头文件的路径 [英] Path To Header File In C
本文介绍了C中头文件的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我的头文件的路径是
c:\ FB \ Header \ pcap.h
我要这样写吗?
If the path to my header file is
c:\FB\Header\pcap.h
Do I write it as following?
#include "..\\C\\FB\Header\\pcap.h"
这是在Windows中.
谢谢
DS
This is in windows.
Thank You
DS
推荐答案
SA是正确的,请使用相对位置...
SA is correct, use relative locations...
#include "..\\lib\\winpcap\\pcap.h"
或者,在您的ide中将目录(也要相对指定)作为默认的头文件/库位置之一包含在内,您只需执行以下操作即可:
Or, include the directory (specify relatively as well) as one of default header/library locations in your ide and you can simply do:
#include <pcap.h>
这样一来,您就可以将项目从一台计算机移至另一台计算机而不会出现问题.如果您正在与团队合作发展,那就太好了.
This will let you move the project from one computer to another without having issues. Great if you''re developing with a team.
这篇关于C中头文件的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文