Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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"


This is in windows.

Thank You
DS
Posted
Updated 12-Apr-11 15:13pm
v2
Comments
HimanshuJoshi 12-Apr-11 21:14pm    
Edited to correct pre tag.
Albert Holguin 13-Apr-11 0:08am    
oh, by the way... the ".." portion means one directory up or "." one directory down... so you can use that accordingly

1 solution

SA is correct, use relative locations...
#include "..\\lib\\winpcap\\pcap.h"


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.
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 12-Apr-11 23:58pm    
This is different story, my 5.
--SA
Albert Holguin 13-Apr-11 0:00am    
thanks :)
Sergey Alexandrovich Kryukov 13-Apr-11 0:00am    
By the way, am I right that the format "./lib/windcap/pcap.h" will work?
It would make the path name more supportable, which is much better...
--SA
Albert Holguin 13-Apr-11 0:03am    
yeah, i NEVER specify exact (static) paths, i have to work with a team, so doing so is just shooting yourself (or team) in the foot.
Sergey Alexandrovich Kryukov 13-Apr-11 0:09am    
:-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900