Using the basic example shown in the readme on linux, zydis-rs builds and links just fine (with dependecy zydis = { git = "https://github.com/zyantific/zydis-rs"}):
However, on Windows/Visual Studio, the example fails:
I believe this is because on Windows, cmake builds the zydis-c static libraries in a subdirectory named after CMAKE_BUILD_TYPE, eg. Build. On linux, the static libraries are placed into the root build directory.
See this is the build root, and Zycore.lib is not found:
but is placed in ./Debug/:
and likewise for Zydis.lib.
As I'm still fairly new to rust and not familiar with the cmake crate, I'm not sure if this is common behavior. I'll make an attempt to update build.rs to autodetect Windows/Visual Studio and fix the build path; though, you may have better ideas for a fix.
Oh, the project links just fine if I manually copy Zycore.lib (and Zydis.lib) into the build roots and re-run the build, demonstrating its simply the above path confusion.
Using the basic example shown in the readme on linux, zydis-rs builds and links just fine (with dependecy
zydis = { git = "https://github.com/zyantific/zydis-rs"}
):However, on Windows/Visual Studio, the example fails:
I believe this is because on Windows, cmake builds the zydis-c static libraries in a subdirectory named after
CMAKE_BUILD_TYPE
, eg.Build
. On linux, the static libraries are placed into the root build directory.See this is the build root, and
Zycore.lib
is not found:but is placed in
./Debug/
:and likewise for
Zydis.lib
.As I'm still fairly new to rust and not familiar with the
cmake
crate, I'm not sure if this is common behavior. I'll make an attempt to updatebuild.rs
to autodetect Windows/Visual Studio and fix the build path; though, you may have better ideas for a fix.