microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
23.12k stars 6.38k forks source link

VCPKG does not copy dependency pdb files in output directory #37943

Open Belox86 opened 6 months ago

Belox86 commented 6 months ago

Discussed in https://github.com/microsoft/vcpkg/discussions/37828

Originally posted by **Belox86** March 29, 2024 Hi everyone, i have multiple "internal" library which i'm trying to manage with vcpkg+cmake. Generally speaking everything is working properly. I have only one minor issue which i can't solve. When working in a project that uses my internal dependecies (in Windows with MSVC compiler) i can't have the pdbs of my internal dependencies copied along with the dlls. The dependencies have the vcpkg_copy_pdbs() in the portfile and they properly export the pdbs in the local cache ..\build\vcpkg_installed\x64-windows\debug\bin along with the dlls. it just miss the final step to have them copied where the executable files is placed so that dependencies symbol can be load. Note that the dependecies dlls are copied from the local cache to the output directories and the program starts properly. Also the pdb of the project itself are in the output directory. Only the pdb of the dependecies are missing. What is the proper way to handle this? It seems strange to me that vcpkg handle everything and then it just miss the final copy. Thank you very much. Michele
FrankXie05 commented 6 months ago

@Belox86 Thanks for posting this issue. Could you please provide an example? For example: After installing the port, the dependency dll is missing. :)

Belox86 commented 6 months ago

ok i will try to do an example: My project has tinyxml2 as dependency which is available from the official vcpkg repository. so in my vcpkg.json file i have: "dependencies": [ { "name": "vcpkg-cmake", "host": true }, { "name":"tinyxml2" } ] when i run cmakeand cmake --build with -config Debug the port is successfully installed and my application compiled. In the folder myProject\build\Debug i find the tinyxml2.dll but not the tinyxml2.pdb. tinyxml2.pdb is present only in the local vcpkg cache in myProject\build\vcpkg_installed\x64-windows\debug\bin but not copied in the output directory along with its dll. How can i have dependencies pdbs copy with dlls in output directory?

jjYBdx4IL commented 6 months ago

I just had the same issue after relocating the vcpkg installation. Try clearing the package archives (zips) and rebuilding the package from source. There is no need for the dependency pdbs to get copied into the output folder. MSVC will find them at their isntalled location.

FrankXie05 commented 6 months ago

cc @BillyONeal

aline117 commented 2 weeks ago

I personally think that as long as the PDB file is generated at compile time, you need to copy the output directory