Vous avez un projet C++ VC9 très simple, il se compose d'un fichier d'en-tête et un fichier source,Erreur dans xutility en incluant <string>
#ifndef t_h
#define t_h
#include <string>
std::string foo();
#endif // t_h
et
#include "t.h"
std::string foo(){return "foo";};
journal de construction pour ce projet est
1>t.cpp
1>C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\xutility(945) : error C2766: explicit specialization; 'std::iterator_traits<size_t>' has already been defined
1> C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\xutility(877) : see previous definition of 'iterator_traits<unsigned __int64>'
1>C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\xutility(1472) : error C2766: explicit specialization; 'std::_Ptr_cat_helper<size_t*,size_t*>' has already been defined
1> C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\xutility(1384) : see previous definition of '_Ptr_cat_helper<unsigned __int64 *,unsigned __int64 *>'
1>C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\xutility(1478) : error C2766: explicit specialization; 'std::_Ptr_cat_helper<const size_t*,size_t*>' has already been defined
1> C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\xutility(1390) : see previous definition of '_Ptr_cat_helper<unsigned __int64 const *,unsigned __int64 *>'
EDIT * Dans le fichier de xutility que j'ai, ces erreurs sont dans #ifdef _LONGLONG
blocs; aucune idée où _LONGLONG
est défini. *
Construire sur la plate-forme 32 est très bien. Quelqu'un pourrait-il savoir comment corriger ces erreurs? Merci.
fichier de projet, dans le cas peu probable que quelqu'un examinerait elle:
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="test"
ProjectGUID="{E9D20D01-C8A4-4477-BD8A-61BB92D3AB77}"
RootNamespace="test"
Keyword="ManagedCProj"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
<Platform
Name="x64"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="2"
ManagedExtensions="0"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=".\.."
PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
StructMemberAlignment="0"
ObjectFile="$(IntDir)\"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\lib\test_x32_mtd.lib"
AdditionalLibraryDirectories=""
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="2"
ManagedExtensions="0"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=".\.."
PreprocessorDefinitions="WIN64;_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
StructMemberAlignment="0"
ObjectFile="$(IntDir)\"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\lib\test_x64_mtd.lib"
AdditionalLibraryDirectories=""
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="2"
ManagedExtensions="0"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=".\.."
PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS"
BasicRuntimeChecks="0"
RuntimeLibrary="2"
StructMemberAlignment="0"
ObjectFile="$(IntDir)\"
WarningLevel="3"
DebugInformationFormat="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\lib\test_x32_mt.lib"
AdditionalLibraryDirectories=""
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="2"
ManagedExtensions="0"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=".\.."
PreprocessorDefinitions="WIN64;NDEBUG"
BasicRuntimeChecks="0"
RuntimeLibrary="2"
StructMemberAlignment="0"
ObjectFile="$(IntDir)\"
WarningLevel="3"
DebugInformationFormat="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\lib\test_x64_mt.lib"
AdditionalLibraryDirectories=""
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath=".\t.cpp"
>
</File>
<File
RelativePath=".\t.h"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
Vous avez changé LONGLONG de __int64 en size_t. Très malsain. Vérifiez l'horodatage des fichiers dans le répertoire vc/include et assurez-vous qu'ils sont toujours les fichiers d'origine et qu'ils n'ont pas été modifiés accidentellement par un contrôle Edit + Replace hors de contrôle. –
Vous aviez raison, j'ai vissé accidentiellement un des fichiers VC. Merci de votre aide! –