microsoft / vcpkg

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

[crashpad] build failure on MSVC #39749

Open LinusChen-yf opened 2 months ago

LinusChen-yf commented 2 months ago

Operating system

Windows

Compiler

MSVC

Steps to reproduce the behavior

The installation of vcpkg is completed normally, but an error will be reported when building the project.

Failure logs

I included the crashpad header file, but the header file cannot find the corresponding dependent header file.

\vcpkg_installed\x64-windows\x64-windows\include\crashpad\base\files\file_path.h(110,10): error C1083: Cannot open include file: 'build/build_config.h': No such file or directory

I tried to add the crashpad directory to my project's additional include dir, and I didn't encounter this problem, but it would conflict with my project's compilation environment.

mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in xxx.obj

Additional context

No response

Cheney-W commented 1 month ago

Could you please provide the following information:

  1. The command you used to install crashpad via vcpkg.
  2. The version of your Visual Studio.
  3. The Visual Studio project or test code you used to test crashpad.
dg0yt commented 1 month ago

I tried to add the crashpad directory to my project's additional include dir,

That's probably necessary if not using CMake.

mismatch detected for 'RuntimeLibrary'

You must set the vcpkg target triplet as needed.

LinusChen-yf commented 1 month ago

Sorry for taking so long to reply. Since it took a lot of time, I used minidump instead.

The environment at that time was like this: I used the following command to install crashpad. I have a vcpkg json file.

vcpkg install --x-wait-for-lock --triplet "x64-windows" --vcpkg-root %vcpkg_path% --x-manifest-root=.\{project_dir} --x-install-root=.\{project_dir}\vcpkg_installed\x64-windows\

vcpkg integrate install

Visual Studio is the latest 2022 version, MSVC v143.

For the code in my project, as long as crashpad_client.h is included in the main.cc file, crashpad_client.h will report an error that it cannot find the crashpad\base\files\file_path.h dependency.

I have used many other libraries of vcpkg, and they do not require me to add additional inlcude directories. The header files I depend on can find their own dependencies. So I think this may be a bug.

github-actions[bot] commented 2 weeks ago

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 28 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.