473,396 Members | 1,996 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,396 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 1481
> 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...
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:
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.