Conan version: 1.7.3
CMake: 3.12.1
Operating System: Windows 10.0.17134
When I run Conan on Windows:
conan install ${CMAKE_CURRENT_SOURCE_DIR} ${profile_flag} -s build_type=Debug -g cmake_multi -b missing
conan install ${CMAKE_CURRENT_SOURCE_DIR} ${profile_flag} -s build_type=Release -g cmake_multi -b missing
Everything works fine, but when compiling the project in Debug configuration in the latest Microsoft Visual Studio, I get the following warnings:
3>fmtd.lib(format.obj) : warning LNK4099: PDB 'fmt.pdb' was not found with 'fmtd.lib(format.obj)' or at 'C:\Projects\sphere-game\build.windows\Debug\fmt.pdb'; linking object as if no debug info
3>glfw3.lib(context.obj) : warning LNK4099: PDB 'glfw.pdb' was not found with 'glfw3.lib(context.obj)' or at 'C:\Projects\sphere-game\build.windows\Debug\glfw.pdb'; linking object as if no debug info
3>glfw3.lib(init.obj) : warning LNK4099: PDB 'glfw.pdb' was not found with 'glfw3.lib(init.obj)' or at 'C:\Projects\sphere-game\build.windows\Debug\glfw.pdb'; linking object as if no debug info
3>glfw3.lib(input.obj) : warning LNK4099: PDB 'glfw.pdb' was not found with 'glfw3.lib(input.obj)' or at 'C:\Projects\sphere-game\build.windows\Debug\glfw.pdb'; linking object as if no debug info
3>glfw3.lib(monitor.obj) : warning LNK4099: PDB 'glfw.pdb' was not found with 'glfw3.lib(monitor.obj)' or at 'C:\Projects\sphere-game\build.windows\Debug\glfw.pdb'; linking object as if no debug info
3>glfw3.lib(vulkan.obj) : warning LNK4099: PDB 'glfw.pdb' was not found with 'glfw3.lib(vulkan.obj)' or at 'C:\Projects\sphere-game\build.windows\Debug\glfw.pdb'; linking object as if no debug info
3>glfw3.lib(window.obj) : warning LNK4099: PDB 'glfw.pdb' was not found with 'glfw3.lib(window.obj)' or at 'C:\Projects\sphere-game\build.windows\Debug\glfw.pdb'; linking object as if no debug info
3>glfw3.lib(win32_init.obj) : warning LNK4099: PDB 'glfw.pdb' was not found with 'glfw3.lib(win32_init.obj)' or at 'C:\Projects\sphere-game\build.windows\Debug\glfw.pdb'; linking object as if no debug info
3>glfw3.lib(win32_joystick.obj) : warning LNK4099: PDB 'glfw.pdb' was not found with 'glfw3.lib(win32_joystick.obj)' or at 'C:\Projects\sphere-game\build.windows\Debug\glfw.pdb'; linking object as if no debug info
3>glfw3.lib(win32_monitor.obj) : warning LNK4099: PDB 'glfw.pdb' was not found with 'glfw3.lib(win32_monitor.obj)' or at 'C:\Projects\sphere-game\build.windows\Debug\glfw.pdb'; linking object as if no debug info
3>glfw3.lib(win32_time.obj) : warning LNK4099: PDB 'glfw.pdb' was not found with 'glfw3.lib(win32_time.obj)' or at 'C:\Projects\sphere-game\build.windows\Debug\glfw.pdb'; linking object as if no debug info
3>glfw3.lib(win32_tls.obj) : warning LNK4099: PDB 'glfw.pdb' was not found with 'glfw3.lib(win32_tls.obj)' or at 'C:\Projects\sphere-game\build.windows\Debug\glfw.pdb'; linking object as if no debug info
3>glfw3.lib(win32_window.obj) : warning LNK4099: PDB 'glfw.pdb' was not found with 'glfw3.lib(win32_window.obj)' or at 'C:\Projects\sphere-game\build.windows\Debug\glfw.pdb'; linking object as if no debug info
3>glfw3.lib(wgl_context.obj) : warning LNK4099: PDB 'glfw.pdb' was not found with 'glfw3.lib(wgl_context.obj)' or at 'C:\Projects\sphere-game\build.windows\Debug\glfw.pdb'; linking object as if no debug info
3>glfw3.lib(egl_context.obj) : warning LNK4099: PDB 'glfw.pdb' was not found with 'glfw3.lib(egl_context.obj)' or at 'C:\Projects\sphere-game\build.windows\Debug\glfw.pdb'; linking object as if no debug info
3>SphereGame-windows.vcxproj -> C:\Projects\sphere-game\build.windows\Debug\SphereGame-windows.exe
3>Done building project "SphereGame-windows.vcxproj".
4>LocalPtr.cpp
4>Vector.cpp
4>Generating Code...
4>gmock_main.lib(gtest-all.obj) : warning LNK4099: PDB 'gmock_main.pdb' was not found with 'gmock_main.lib(gtest-all.obj)' or at 'C:\Projects\sphere-game\build.windows\test\Debug\gmock_main.pdb'; linking object as if no debug info
4>gmock_main.lib(gmock-all.obj) : warning LNK4099: PDB 'gmock_main.pdb' was not found with 'gmock_main.lib(gmock-all.obj)' or at 'C:\Projects\sphere-game\build.windows\test\Debug\gmock_main.pdb'; linking object as if no debug info
4>gmock_main.lib(gmock_main.obj) : warning LNK4099: PDB 'gmock_main.pdb' was not found with 'gmock_main.lib(gmock_main.obj)' or at 'C:\Projects\sphere-game\build.windows\test\Debug\gmock_main.pdb'; linking object as if no debug info
4>fmtd.lib(format.obj) : warning LNK4099: PDB 'fmt.pdb' was not found with 'fmtd.lib(format.obj)' or at 'C:\Projects\sphere-game\build.windows\test\Debug\fmt.pdb'; linking object as if no debug info
4>SphereGameTest.vcxproj -> C:\Projects\sphere-game\build.windows\test\Debug\SphereGameTest.exe
4>Done building project "SphereGameTest.vcxproj".
fmt/glfw/gmock are dependencies of my project.
How can I have a clean debug build without warnings?
Many thanks.
Well, the main issue is that those packages seems that haven't packaged the PDBs together with their debug libraries. This is very typical in open-source packages hosted in bintray, because PDBs are huge and you can hit the quota limits if you generate many different binaries for different compiler versions, and release several versions.
I guess it could be silenced in the consumer side build system, but the warning is indeed "fair", there are no PDBs. Something like this in your CMakeLists.txt:
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "/ignore:4099")
I'm a bit confused. I thought Conan compiles the packages from source, rather than download binaries? Wouldn't it generate these PDBs on my system?
Hi @sssilver
Conan does both. It can compile the packages from sources, if the recipe properly defines how to build it. But it is also able to model binaries, and manage them, upload them to the server, and download the matching one for the current configuration, when conan install. In fact, the default behavior when doing conan install is to try to download a binary, and fail if otherwise. If --build=xxxx argument is provided, then it will build it from sources instead of downloading the binary.
When building from sources, in the local cache, yes, the PDBs will be there, in the cached "build" folder, and then it might be possible to use them there. Depending on the system, it might still be necessary to copy the PDBs in the package() method, so they are found when linking with them.
See https://github.com/bincrafters/community/issues/126 as well.
Is it possible to add a flag to the Conan profile so all debug builds keep PDBs and install them? Changing compiler options to add /Z7 when building with MSVC Debug mode seems more involved and harder to maintain in the long run.
I see a number of packages in conan-center-io are just removing pdb files . But I have lived through enough debug sessions where I had to chase callbacks into and out of 3rd party libraries that I can appreciate the debug info being there when I need it.
Most helpful comment
Hi @sssilver
Conan does both. It can compile the packages from sources, if the recipe properly defines how to build it. But it is also able to model binaries, and manage them, upload them to the server, and download the matching one for the current configuration, when
conan install. In fact, the default behavior when doingconan installis to try to download a binary, and fail if otherwise. If--build=xxxxargument is provided, then it will build it from sources instead of downloading the binary.When building from sources, in the local cache, yes, the PDBs will be there, in the cached "build" folder, and then it might be possible to use them there. Depending on the system, it might still be necessary to copy the PDBs in the
package()method, so they are found when linking with them.