Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[zydis] error LNK2019: unresolved external symbol _ZydisGetRelInfo referenced in function _RunBranchingTests #415

Closed
JonLiu1993 opened this issue Feb 10, 2023 · 1 comment · Fixed by #416

Comments

@JonLiu1993
Copy link

JonLiu1993 commented Feb 10, 2023

Hi, I have a question I would like to ask everyone. When I upgraded zydis from version 3.2.1 to 4.0.0 on vcpkg, I encountered a LNK error:

ZydisTestEncoderAbsolute.c.obj : error LNK2019: unresolved external symbol _ZydisGetRelInfo referenced in function _RunBranchingTests

When I went to try to solve this problem I found a strange problem:
The function ZydisEncoderRelInfo https://github.com/zyantific/zydis/blob/master/include/Zydis/Internal/EncoderData.h#L247 containing the symbol ZydisGetRelInfo is not exported, GetRelInfo.inc was not included in the compilation process, which caused the symbol ZydisGetRelInfo to be unrecognized during the link process. I would like to know what is the reason for this design? thanks!

@mappzor
Copy link
Contributor

mappzor commented Feb 11, 2023

I would like to know what is the reason for this design? thanks!

This is an internal test suite, so it can access private, unexported functions/data and it doesn't need to work on all configurations. In particular it won't build on Windows in shared library mode. In MSVC projects we provide this tool is excluded from shared library builds but CMake doesn't do that. I don't know much about vcpkg but I assume that CMake issue is a root cause here. I opened a PR to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants