473,382 Members | 1,271 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,382 software developers and data experts.

#include <filename.h> broken in VC7

Did you know that the #include directive when using angle
brackets works substantially differently in VC7 than it
did in VC6?

It used to be that the reference for the additional
include directories that you specify for the project
started from the project directory. Now it appears to
start from the directory that you're including the file
from. So if you have a directory structure like this:

Client
Server
Admin

where there are shared files at the Client level, your
include paths simply don't work. As a result, we're going
to have to completely reorganize our directory tree and
lose a substantial amount of productivity for a few days
while we fix this mess.

This wouldn't be so bad, except we're dealing with another
bug that MS has acknowledged, but not yet fixed, which is
generating a massive number of bogus warning messages
*and* which is why we didn't notice this problem until now.

Add that to the fact that our programmers are in a full
revolt over the new interface, and you start to wonder why
we bothered to upgrade.

(BTW, the search function in the newsgroups doesn't work
either, so I have no idea whether anyone has reported this
or not.)
Nov 16 '05 #1
2 1478
> From: "Bill Roper" <an*******@discussions.microsoft.com>

Did you know that the #include directive when using angle
brackets works substantially differently in VC7 than it
did in VC6?

It used to be that the reference for the additional
include directories that you specify for the project
started from the project directory. Now it appears to
start from the directory that you're including the file
from. So if you have a directory structure like this:

Client
Server
Admin

where there are shared files at the Client level, your
include paths simply don't work. As a result, we're going
to have to completely reorganize our directory tree and
lose a substantial amount of productivity for a few days
while we fix this mess.


Bill - I can't seem to reproduce the problem you are
describing. The build system invokes the compiler from the
project directory. In your example, the compiler command-line
for a file in the "Server" directory should be something
like:

CL Server\filename.cpp /I. /allothercompileroptions

This way the compiler should find your include files that
live in the project directory.

What is the compiler command-line in your build log? That
should provide a clue on what could be going wrong.

Also, you can always use project macros (e.g. $(ProjectDir))
to eliminate any problems caused by relative paths. You do not
need to restructure your directories.

Thanks,
--
Tarek Madkour, Visual C++ Team
This posting is provided AS IS with no warranties, and confers no rights.

Nov 16 '05 #2
-----Original Message-----
From: "Bill Roper" <an*******@discussions.microsoft.com>

Did you know that the #include directive when using angle brackets works substantially differently in VC7 than it
did in VC6?

It used to be that the reference for the additional
include directories that you specify for the project
started from the project directory. Now it appears to
start from the directory that you're including the file
from. So if you have a directory structure like this:

Client
Server
Admin

where there are shared files at the Client level, your
include paths simply don't work. As a result, we're going to have to completely reorganize our directory tree and
lose a substantial amount of productivity for a few days while we fix this mess.

Bill - I can't seem to reproduce the problem you are
describing. The build system invokes the compiler from

theproject directory. In your example, the compiler command- linefor a file in the "Server" directory should be something
like:

CL Server\filename.cpp /I. /allothercompileroptions

This way the compiler should find your include files that
live in the project directory.

What is the compiler command-line in your build log? That
should provide a clue on what could be going wrong.

Also, you can always use project macros (e.g. $(ProjectDir))to eliminate any problems caused by relative paths. You do notneed to restructure your directories.


Well, you see that would be the problem.

The Server project includes some files that are in the
Client directory, one level above. In earlier versions of
VC++, when we compiled the Server project, the Include
paths were *relative to the Server directory* regardless
of where the physical CPP file was located.

Now, the Include paths are relative to the location of the
physical CPP file, not the project that is being built.
Since these files contain:

#include <resource.h>

they're retrieving the resources from the wrong project.
Hilarity ensues.

As I said, the behavior is clearly different from earlier
versions of the compiler and -- as far as we can tell --
not what is documented, nor the way that angle brackets
*should* work on an include.
Nov 16 '05 #3

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

Similar topics

2
by: Eshrath | last post by:
Hi, What I am trying to do: ======================= I need to form a table in html using the xsl but the table that is formed is quite long and cannot be viewed in our application. So we are...
2
by: Donald Firesmith | last post by:
I am having trouble having Google Adsense code stored in XSL converted properly into HTML. The <> unfortunately become &lt; and &gt; and then no longer work. XSL code is: <script...
18
by: Tuckers | last post by:
My question is, if I have created my own library which lives in its own install directory, to refer to its header file is it better to use #include "MyLibrary.h" or #include <MyLibrary.h> ...
9
by: bill | last post by:
Forget the exact definition of difference between, #include <foo.h> and #include "bar.h" Normally foo.h is a standard header file, so it's path is not defined in compiler option, but I...
1
by: joe10001 | last post by:
Hi all, I just installed CRELoaded (oscommerce fork) on my server and all work fine except that I have a little message at the bottom of the main page : Fatal error: main() : Security alert:...
17
by: roN | last post by:
Hi, I'm creating a Website with divs and i do have some troubles, to make it looking the same way in Firefox and IE (tested with IE7). I checked it with the e3c validator and it says: " This...
3
by: ajay2552 | last post by:
Hi, I have a query. All html tags start with < and end with >. Suppose i want to display either '<' or '>' or say some text like '<Company>' in html how do i do it? One method is to use &lt,...
14
by: Michael | last post by:
Since the include function is called from within a PHP script, why does the included file have to identify itself as a PHP again by enclosing its code in <?php... <?> One would assume that the...
7
by: huili80 | last post by:
Should complex<T>::real() and imag() return a value or a refernce? What does the standard say about this? I just realized that MSVC2008's implementation returns a value, but in GCC reference is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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.