473,378 Members | 1,500 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Setting project include directories (VC 7.1): #include <file> vs#include "file"

Hi,

I am (trying) to compile some code I downloaded from the internet. The
sources contain references to header files - using the form :

#include <pathname/file>

If I change the form to this:

#include "pathname/file"

The file can be compiled. The only problem is that I do not want to edit
the original source files as above, I just want to set up the search
path (like you do by specifying with -I option when compiling with gcc ).

I have gone to the project properties (C/C++->General->Additional
Include) and set this to pathname - still no joy.

I need to know how to set up VC++ so that I can add pathname to my
search path, so that I can automatically compile code containing
preprocesser directives like:

#include <pathname/filename.h> // <- Note angled brackets

Any help wil be much appreciated. Thanks

Nov 17 '05 #1
2 2969
Susan Baker wrote:
Hi,

I am (trying) to compile some code I downloaded from the internet. The
sources contain references to header files - using the form :

#include <pathname/file>

If I change the form to this:

#include "pathname/file"
.... which must mean that the file being included is being found by a path
that's relative to the location of the file containing the #include
directive, as that's the only difference between #include "file" and
#include <file>. e.g.

ProjDir/
foo.cpp contains #include <bar/baz.h>
bar/
baz.h

Traditionally, this would be considered an inappropriate use of #include <>
as that was intended to be for system supplied header files, while #include
" " was intended to be used for headers that are part of your project.

The file can be compiled. The only problem is that I do not want to
edit the original source files as above, I just want to set up the
search path (like you do by specifying with -I option when compiling with
gcc ).
I have gone to the project properties (C/C++->General->Additional
Include) and set this to pathname - still no joy.

I need to know how to set up VC++ so that I can add pathname to my
search path, so that I can automatically compile code containing
preprocesser directives like:

#include <pathname/filename.h> // <- Note angled brackets

Any help wil be much appreciated. Thanks


In the solution explorer, right-click on the project node and choose
Properties from the context menu. Find the C/C++/General node in the
tree-view of the properties window. Select All Configurations from the
Configuration combo-box at the top left of the dialog. In the Additional
Include Directories box, type $(ProjectDir). If there are already one or
more directories listed there, use a semi-colon to separate directories (the
UI will accept space-delimitted directories as well, but they won't be
searched properly - the compiler will see it as one long path). You can
also click on the little [...] button on the far-right of the edit box to
bring up a dialog that lets you build paths from the available project
macros and automatically adds the semicolon delimitters as well.

If that doesn't get you going, please reply with a description of the
directory structure of the project, including the locations of the file that
contains the #include as well as the file named in the #include.

-cd
Nov 17 '05 #2
Thanks - I've got it sorted out now.

Carl Daniel [VC++ MVP] wrote:
Susan Baker wrote:
Hi,

I am (trying) to compile some code I downloaded from the internet. The
sources contain references to header files - using the form :

#include <pathname/file>

If I change the form to this:

#include "pathname/file"

... which must mean that the file being included is being found by a path
that's relative to the location of the file containing the #include
directive, as that's the only difference between #include "file" and
#include <file>. e.g.

ProjDir/
foo.cpp contains #include <bar/baz.h>
bar/
baz.h

Traditionally, this would be considered an inappropriate use of #include <>
as that was intended to be for system supplied header files, while #include
" " was intended to be used for headers that are part of your project.

The file can be compiled. The only problem is that I do not want to
edit the original source files as above, I just want to set up the
search path (like you do by specifying with -I option when compiling with
gcc ).
I have gone to the project properties (C/C++->General->Additional
Include) and set this to pathname - still no joy.

I need to know how to set up VC++ so that I can add pathname to my
search path, so that I can automatically compile code containing
preprocesser directives like:

#include <pathname/filename.h> // <- Note angled brackets

Any help wil be much appreciated. Thanks

In the solution explorer, right-click on the project node and choose
Properties from the context menu. Find the C/C++/General node in the
tree-view of the properties window. Select All Configurations from the
Configuration combo-box at the top left of the dialog. In the Additional
Include Directories box, type $(ProjectDir). If there are already one or
more directories listed there, use a semi-colon to separate directories (the
UI will accept space-delimitted directories as well, but they won't be
searched properly - the compiler will see it as one long path). You can
also click on the little [...] button on the far-right of the edit box to
bring up a dialog that lets you build paths from the available project
macros and automatically adds the semicolon delimitters as well.

If that doesn't get you going, please reply with a description of the
directory structure of the project, including the locations of the file that
contains the #include as well as the file named in the #include.

-cd


Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Oleg Ogurok | last post by:
Hi all, I have a C# class library project that needs to be registered for COM interoperability. I set the "Register for COM Interop" to true in the project's properties. When compiled, VS.NET...
4
by: Exits Funnel | last post by:
Hello, I'm slightly confused about when to use parens around #included files and when to use angle brackets. I understand (I think) that the difference is that the compiler will search in its...
2
by: Susan Baker | last post by:
Hi, I am (trying) to compile some code I downloaded from the internet. The sources contain references to header files - using the form : #include <pathname/file> If I change the form to...
2
by: a | last post by:
I keep getting this message, "unable to get the project file from the web server" when I try to open a new project that I just copied. I created a virtual director with IIS 5 (VS2002). Trying to...
1
by: David | last post by:
I am working on a small web app. I attempted to copy it to the remote server via. the project/copy command and when I closed the project and attempted to reopen it, I get the error "project file...
9
by: Anubhav Jain | last post by:
Hi, I am having few .net source files(.cs or .vb) and I want to dynamically generate the corresponding .net project file(.csproj or .vbproj) for them without using visual studio.So that I could...
10
by: vunet.us | last post by:
What is the workaround of passign a parameter to any included asp file: <!-- #Include File="file.asp" --> This obviously does not work: <!-- #Include File="file.asp?id=123" --> Thank you
2
by: naveeddil | last post by:
Hello, I use this command for including my ASP files into another it is working perfectly on my XP 2002 SP2, IIS server and also i upload to brinkster.com and working perfectly there but here is...
2
by: kkshansid | last post by:
i am from asp background i am very new to asp.net environment i want to know that is there any include in asp.net as in asp so that i can include connection file which is asp.net and asp files ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.