On a C++ solution, with multiple projects in it, I get this error when I set a breakpoint in any of the C++ dependency’s source code :
The breakpoint will not currently be hit. No symbols have been loaded for this document
Let’s say the solution is as follow :
Sol
ProjA
ProjB
ProjC
ProjA contains the main entry point. Setting breaking points on this project source code works. The vcxproj file for ProjA contains the following (only relevent parts) :
<ProjectConfiguration Include="Unicode Debug|Win32">
<Configuration>Unicode Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
...
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<UseOfMfc>Dynamic</UseOfMfc>
<UseOfAtl>false</UseOfAtl>
<CharacterSet>Unicode</CharacterSet>
<CLRSupport>true</CLRSupport>
</PropertyGroup>
...
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode Debug|Win32'">
<OutDir>$(SolutionDir)build$(Configuration)$(Platform)</OutDir>
<IntDir>$(SolutionDir)build$(Configuration)$(Platform)temp3</IntDir>
<LinkIncremental>true</LinkIncremental>
<EnableManagedIncrementalBuild>true</EnableManagedIncrementalBuild>
<TargetName>program</TargetName>
</PropertyGroup>
...
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Unicode Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>[omitted]</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;_MBCS;_AFXDLL;WIN32;_WINDOWS;UNICODE;_DONTUSECRASHHANDLER;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>$(IntDir)Poems.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
<ObjectFileName>$(IntDir)</ObjectFileName>
<ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>
<BrowseInformation>false</BrowseInformation>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>CompileAsCpp</CompileAs>
<CompileAsManaged>true</CompileAsManaged>
<MultiProcessorCompilation>false</MultiProcessorCompilation>
<LanguageStandard>stdcpp17</LanguageStandard>
<FloatingPointModel>Fast</FloatingPointModel>
<ExceptionHandling>false</ExceptionHandling>
</ClCompile>
<Link>
<AdditionalDependencies>[omitted]</AdditionalDependencies>
<OutputFile>$(OutDir)program.exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories);..bin</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)smget.pdb</ProgramDatabaseFile>
<GenerateMapFile>true</GenerateMapFile>
<MapFileName>$(OutDir)smget.map</MapFileName>
<SubSystem>Windows</SubSystem>
<EntryPointSymbol>wWinMainCRTStartup</EntryPointSymbol>
<TargetMachine>MachineX86</TargetMachine>
<AssemblyDebug>true</AssemblyDebug>
<LinkTimeCodeGeneration>UseFastLinkTimeCodeGeneration</LinkTimeCodeGeneration>
</Link>
<Midl>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment>
<TypeLibraryName>...Install/Poems.tlb</TypeLibraryName>
<HeaderFileName />
</Midl>
<PostBuildEvent>
<Message>
</Message>
<Command>
</Command>
</PostBuildEvent>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0809</Culture>
</ResourceCompile>
</ItemDefinitionGroup>
However, ProjB breakpoint does not work when running Local Windows Debugger and I get the mentionned error message. Using VS2017, I’ve checked C/C++ -> General -> Debug Info Format is /Zi, no CLR. Linker -> debugging pdb for ProjB is created at $(OutDir), General Debug Info is set to /DEBUG. There is also a map file created.
I’ve cleaned the build folder mutiple time. I’ve uninstalled the program (because a version of that program was installed) to avoid dll being loaded from elsewhere.