claremacrae / googletest-starter-project

Place to experiment with googletest and conan builds
MIT License
0 stars 0 forks source link

Fix "PDB 'gtest.pdb' was not found" warnings with Debug and RelWithDebInfo configs #3

Open claremacrae opened 6 years ago

claremacrae commented 6 years ago

In https://github.com/claremacrae/googletest-starter-project/commit/35f1056a1d2b171602280b8ede9890422ea69076, linking Debug and RelWithDebInfo configs gives this warning:

gtest.lib(gtest-all.obj) : warning LNK4099: PDB 'gtest.pdb' was not found with 'gtest.lib(gtest-all.obj)' 
or at 'C:\Users\Clare\Documents\Programming\GitHub\googletest-starter-project\build-windows\tests\RelWithDebInfo\gtest.pdb'; 
linking object as if no debug info 
[C:\Users\Clare\Documents\Programming\GitHub\googletest-starter-project\build-windows\tests\tests.vcxproj]
claremacrae commented 6 years ago

Possibly related? https://stackoverflow.com/questions/40860435/how-to-get-cmake-to-install-pdb-files-for-targets

claremacrae commented 6 years ago

From a conversation on the CppLang Conan Slack channel, I realised that:

  1. Conan doesn't supply the source code for dependencies
  2. Even if it did, the .pdb files by default wouldn't be useful, as they would require the source to be in the same location as it was on whatever machine compiled the source code

Diego pointed out that there are some good insights here: https://github.com/conan-io/conan/issues/1796#issuecomment-368544799

Also, it appears that it is not possible to disable this warning on Visual Studio: https://stackoverflow.com/questions/661606/visual-c-how-to-disable-specific-linker-warnings

So I don't think that this is either fixable or suppressible.