PolyHook_2_0: VCPKG bad include folder structure
Hi, I tried installing this using vcpkg and getting the following error when including x64Detour.hpp:
I:\vcpkg\installed\x64-windows\include\x64Detour.hpp(13,10): fatal error C1083: Cannot open include file: 'headers/Detour/ADetour.hpp': No such file or directory
Looking at the include folder of vcpkg:

and the content of x64Detour.hpp:
...
#include "headers/Detour/ADetour.hpp"
...
the Problem seems to be that files from headers/Detour/... are here, but the folder structure was flattened (into vcpkg’s include directory)?
If I somehow messed up any installation part, I’d appreciate a hint (I’m new to using vcpkg)
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 29 (29 by maintainers)
https://github.com/microsoft/vcpkg/pull/9932
The pr has been merged, using vcpkg install polyhook2 should work as expected now!
Doing some further digging into how capstone is configured as its headers are inside the capstone directory.
Inside capstones cmake
install(FILES ${HEADERS_COMMON} DESTINATION include/capstone)from the cmake_install.cmake for capstone
seems like this is what vcpkg is using to decide where its output headers go.
Since this repo is lacking any such configuration everything gets dropped into the base includes directory which is not optimal.
I guess there are a few different ways this could be resolved, but I imagine the cleanest way would be to specify a overarching include directory for all the files so everything gets put inside a single polyhook2 directory, and then specify the relative folders for where every header is supposed to be so that cmake puts them in the correct place.
Otherwise a similar patch file that’s inside the polyhook2 ports directory for vcpkg could be setup to modify all the headers, but I think having all of polyhooks headers just dropped into the base includes folder isn’t very good style.
I was actually in the process of writing up my own issue for this very same problem.
There is a further issue, even if you correct the headers by removing the “header/” and “detour/” chunks, something is wrong with how capstone is being compiled.
It seems like capstone has no active architectures enabled
I used
setup a small program c++ program
added
to the
<PropertyGroup Label="Globals">in the .vcxprojand upon execution you get
error opening capI stepped into cs_open and it seems like cs_arch_init is empty. So even if the header issue gets resolved it seems like there is a secondary issue with capstone. I’ve not used vcpkg for very long either so perhaps I too am missing something