> I have a main project that depends on projects A and B. The main
> project's additional include directories list is:
[quoted text clipped - 20 lines]
> I do not control code for projects A and B and hence cannot rename
> cppfile1.h. Any help would be greatly appreciated.
The .cpp file in question does not further qualify the name of the header
file.
The .cpp file is "main.cpp", which includes "XXXProduct.ver". The .ver file
includes "cppfile1.h". Instead of getting it from include path
"..\BasicOuterLayer\Dist\Include" it gets it from "..\Share\Include".
Interestingly enough if I delete "cppfile1.h" from "..\Share\Include" the
project compiles with the correct version from
"..\BasicOuterLayer\Dist\Include". Also, once I have been able to build and
link successfully, I cannot reproduce the problem when the wrong version of
"cppfile1.h" is copied back to "..\Share\Include". Even if I do a rebuild on
the project. This issue has been reproduced in-house by other developers on
a different project.
The simplified .NET project file is:
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="XXXProduct"
ProjectGUID="{3DF4856C-4223-4DD3-A93B-640C4525E02B}"
RootNamespace="XXXProduct"
SccProjectName=""
SccAuxPath=""
SccLocalPath=""
SccProvider="">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="..\Dist\Exe"
IntermediateDirectory=".\Debug"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="1">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\Dist\Include;..\Product_2_SIL\Dist\Include;
..\BasicInnerLayer\Dist\Include;..\BasicOuterLayer\Dist\Include;..\AlarmsEve
nts\Dist\Include;..\ConfigProxyStub\Dist\Include;..\ComfigLibrary\Dist\Inclu
de;..\OuterLayerConfigProxyStub\Dist\Include;..\HardwareKeyLicensing\Dist\In
clude;..\SoftwareKeyLicensing\Dist\Include;..\LogLibrary\Dist\Include;..\Dat
aStormProduct_API\Dist\Include;..\DataStormProduct_Core\Dist\Include;..\Data
StormProduct_Client\Dist\Include;..\M3_Interfaces_M3Common\Dist\Include;..\S
hare\Src;..\Share\Include"
PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;UNICODE;_WIN32_WINNT=0x0400;_
CONSOLE;_USE_DEBUGLIB_FILE"
RuntimeLibrary="1"
RuntimeTypeInfo="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Debug/XXXProduct.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
BrowseInformation="1"
BrowseInformationFile=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/fixed:no"
AdditionalDependencies="version.lib Ws2_32.lib Netapi32.lib
MatDebug_dmtw.lib PXPIL_d.lib PXPIL_AE_mtd.lib PXPOLE_XXX_d.lib
PXPIL_Product_d.lib StaticLicense_d.lib dscore_d.lib dsapi_d.lib
DSClientLib_d.lib keylib_d.lib XMLConfigWrapper_d.lib M3Framework_d.lib
M3Common_d.lib"
OutputFile="..\Dist\Exe\XXXProduct_d.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="..\Product_2_SIL\Dist\Lib;..\BasicInnerLayer\D
ist\Lib;..\BasicOuterLayer\Dist\Lib;..\AlarmsEvents\Dist\Lib;..\ComfigLibrar
y\Dist\Lib;..\ConfigProxyStub\Dist\Lib;..\DataStormProduct_API\Dist\Lib;..\D
ataStormProduct_Core\Dist\Lib;..\DataStormProduct_Client\Dist\Lib;..\Hardwar
eKeyLicensing\Dist\Lib;..\LogLibrary\Dist\Lib;..\M3_PeerFramework\Dist\Lib;.
.\XXX_AE_1.0\Dist\Lib;..\XXX_DA_2.0\Dist\Lib;..\XXX_HDA_1.0\Dist\Lib;..\Oute
rLayerConfigProxyStub\Dist\Lib;..\SoftwareKeyLicensing\Dist\Lib;..\Share\Lib
"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/XXXProduct_d.pdb"
GenerateMapFile="TRUE"
MapFileName=".\Debug/XXXProduct_d.map"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\./XXXProduct.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="Incbuild XXXProduct.ver /rc=XXXProduct.rc"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
AdditionalIncludeDirectories="..\Log\Dist\Include;..\BasicInnerLayer\Dist\In
clude;..\XXXOuterLayer\Dist\Include;"..\XXXOuterLayer\Etc\Comfig
Library\Dist\Include";"..\XXXOuterLayer\Etc\Outer Layer Config
Proxy
Stub\Dist\Include";..\Product_SIL\Dist\Include;..\Share\Include;"$
(MTKCOMMON)\WinNT\Include""
ResourceOutputFileName="Debug/OxModicon.res"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<References>
</References>
<Files>
<File
RelativePath="Guids.h">
</File>
<File
RelativePath="icon1.ico">
</File>
<File
RelativePath="main.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="Main.h">
</File>
<File
RelativePath="XXXProduct.rc">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG;$(NoInherit)"/>
</FileConfiguration>
</File>
<File
RelativePath="XXXProduct.ver">
</File>
<File
RelativePath="XXXProduct_version.c">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath=".\resource.h">
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
Content of XXXProduct.ver:
----------------
"\n{"
/* components */
#include "cppfile1.h"
"\n}"
----------------
Any help is greatly appreciated.
- Arpi
> > I have a main project that depends on projects A and B. The main
> > project's additional include directories list is:
[quoted text clipped - 30 lines]
>
> -cd
Carl Daniel [VC++ MVP] - 24 Nov 2004 01:54 GMT
> The .cpp file in question does not further qualify the name of the
> header file.
>
> The .cpp file is "main.cpp", which includes "XXXProduct.ver". The
Where is Product.ver located? If it's in "..\Share\Include", then that's
your problem. The compiler always looks for a #included file in the
directory that contains the including file first (if it's a #include "file",
not a #include <file>, in which case the directory where the including file
was found is ignored).
> .ver file includes "cppfile1.h". Instead of getting it from include
> path "..\BasicOuterLayer\Dist\Include" it gets it from
[quoted text clipped - 3 lines]
> build and link successfully, I cannot reproduce the problem when the
> wrong version of "cppfile1.h" is copied back to "..\Share\Include".
How a difference could survive a full rebuild is hard to envision.
Surviving a normal build is entirely possible, depending on usage of
precompiled headers.
-cd