472,789 Members | 1,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,789 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 2899
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 ...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.