This question already has an answer here:
I am trying to create a new test project used google test to write unit tests for a specific class only in debug and x86 configuration. But I am getting unresolved external symbols for the functions defined in xlocale header file. I am using VS2015.
1>XPLProfileDefinitionCBL.obj : error LNK2019: unresolved external symbol "public: __thiscall CObject::CObject(void)" (??0CObject@@QAE@XZ) referenced in function "public: __thiscall CArray<struct XPLCallBarringArrayEntry,struct XPLCallBarringArrayEntry &>::CArray<struct XPLCallBarringArrayEntry,struct XPLCallBarringArrayEntry &>(void)" (??0?$CArray@UXPLCallBarringArrayEntry@@AAU1@@@QAE@XZ)
1>XPLProfileDefinitionCBLTests.obj : error LNK2001: unresolved external symbol "public: __thiscall CObject::CObject(void)" (??0CObject@@QAE@XZ)
1>XPLProfileDefinitionCBL.obj : error LNK2019: unresolved external symbol "public: static class std::locale::_Locimp * __cdecl std::locale::_Init(bool)" (?_Init@locale@std@@SAPAV_Locimp@12@_N@Z) referenced in function "public: __thiscall std::locale::locale(void)" (??0locale@std@@QAE@XZ)
1>XPLProfileDefinitionCBL.obj : error LNK2019: unresolved external symbol "public: static class std::locale::_Locimp * __cdecl std::locale::_Getgloballocale(void)" (?_Getgloballocale@locale@std@@SAPAV_Locimp@12@XZ) referenced in function "public: class std::locale::facet const * __thiscall std::locale::_Getfacet(unsigned int)const " (?_Getfacet@locale@std@@QBEPBVfacet@12@I@Z)
1>XPLProfileDefinitionCBL.obj : error LNK2001: unresolved external symbol "public: static int std::locale::id::_Id_cnt" (?_Id_cnt@id@locale@std@@2HA)
The .vcsproj file is given below.
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{6713825B-04E6-4F10-B2F1-DA2B97B0E909}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>XPLProfileDefinitionCBLTests</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
<UseOfMfc>false</UseOfMfc>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>Create</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_ALLOW_KEYWORD_MACROS;XNT_NT;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(ProjectDir)../Tools/googletest/include;$(ProjectDir);$(ProjectDir)../SharedMocks/Cpp/ADSInclude;$(ProjectDir)../SharedMocks/Cpp/CDSInclude;$(ProjectDir)../SharedMocks/Cpp/ADSCallControl/CallProcessing;$(ProjectDir)../../ADSInclude;$(ProjectDir)../../ADSCallControl\XMLProfileLibrary</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<ShowIncludes>false</ShowIncludes>
<ExceptionHandling>Async</ExceptionHandling>
<StructMemberAlignment>1Byte</StructMemberAlignment>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>..\Tools\googletest\lib.v140.mt.x86.debug;</AdditionalLibraryDirectories>
<AdditionalDependencies>gmock.lib;gmock_main.lib;gtestd.lib;gtest_maind.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>
</IgnoreSpecificDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\ADSCallControl\XMLProfileLibrary\stdafx.h" />
<ClInclude Include="..\..\ADSCallControl\XMLProfileLibrary\XPLProfileDefinitionCBL.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\ADSCallControl\XMLProfileLibrary\stdafx.cpp" />
<ClCompile Include="..\..\ADSCallControl\XMLProfileLibrary\XPLProfileDefinitionCBL.cpp" />
<ClCompile Include="..\SharedMocks\Cpp\ADSCallControl\XMLProfileLibrary\XMLProfileLibrary.cpp" />
<ClCompile Include="..\SharedMocks\Cpp\ADSCallControl\XMLProfileLibrary\XPLProfileDefinition.cpp" />
<ClCompile Include="..\SharedMocks\Cpp\ADSCallControl\XMLProfileLibrary\XPLProfileDefinitionActivatable.cpp" />
<ClCompile Include="XPLProfileDefinitionCBLTests.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
Please assist me, thanks in advance.
It is not a question about what is unresolved extern symbols, mainly about why getting errors from standard header files.
Aucun commentaire:
Enregistrer un commentaire