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

Build failure on Windows with MSVC \ capstone_static.vcxproj #2317

Open
arkup opened this issue Apr 8, 2024 · 4 comments
Open

Build failure on Windows with MSVC \ capstone_static.vcxproj #2317

arkup opened this issue Apr 8, 2024 · 4 comments
Labels
build & packaging Build system and packaging related Windows
Milestone

Comments

@arkup
Copy link
Contributor

arkup commented Apr 8, 2024

Hi, it seems like the build on Windows is broken. I just tried to compile \capstone-next\msvc\capstone_static\capstone_static.vcxproj with Visual Studio Community 2019 using the provided MSVC project (as I always do), but this time I'm getting a bunch of errors.

capstone-next\arch\ARM\ARMAddressingModes.h(274,32): error C4146: unary minus operator applied to unsigned type, result still unsigned
capstone-next\arch\ARM\ARMAddressingModes.h(277,38): error C4146: unary minus operator applied to unsigned type, result still unsigned
capstone-next\arch\ARM\ARMAddressingModes.h(278,12): error C4146: unary minus operator applied to unsigned type, result still unsigned
capstone-next\arch\ARM\ARMDisassembler.c(6047,28): error C4146: unary minus operator applied to unsigned type, result still unsigned
capstone-next\arch\ARM\ARMDisassembler.c(6048,37): error C4146: unary minus operator applied to unsigned type, result still unsigned
capstone-next\arch\ARM\ARMDisassembler.c(6153,10): error C4146: unary minus operator applied to unsigned type, result still unsigned
capstone-next\arch\ARM\ARMDisassembler.c(6518,1): error C4146: unary minus operator applied to unsigned type, result still unsigned
capstone-next\arch\ARM\ARMDisassembler.c(6519,1): error C4146: unary minus operator applied to unsigned type, result still unsigned
capstone-next\arch\ARM\ARMDisassembler.c(6520,1): error C4146: unary minus operator applied to unsigned type, result still unsigned
capstone-next\arch\ARM\ARMDisassembler.c(6522,3): error C4146: unary minus operator applied to unsigned type, result still unsigned
capstone-next\arch\ARM\ARMDisassembler.c(6523,4): error C4146: unary minus operator applied to unsigned type, result still unsigned
capstone-next\arch\ARM\ARMDisassembler.c(6524,1): error C4146: unary minus operator applied to unsigned type, result still unsigned
capstone-next\arch\ARM\ARMAddressingModes.h(274,32): error C4146: unary minus operator applied to unsigned type, result still unsigned
capstone-next\arch\ARM\ARMAddressingModes.h(277,38): error C4146: unary minus operator applied to unsigned type, result still unsigned
capstone-next\arch\ARM\ARMAddressingModes.h(278,12): error C4146: unary minus operator applied to unsigned type, result still unsigned
capstone-next\arch\ARM\ARMAddressingModes.h(274,32): error C4146: unary minus operator applied to unsigned type, result still unsigned
capstone-next\arch\ARM\ARMAddressingModes.h(277,38): error C4146: unary minus operator applied to unsigned type, result still unsigned
capstone-next\arch\ARM\ARMAddressingModes.h(278,12): error C4146: unary minus operator applied to unsigned type, result still unsigned
capstone-next\arch\ARM\ARMMapping.c(2080,61): error C4146: unary minus operator applied to unsigned type, result still unsigned

Work environment

Questions Answers
OS/arch/bits Windows
Architecture x64
Source of Capstone git clone next branch
Version/git commit cda40c6
@Rot127 Rot127 added the build & packaging Build system and packaging related label Apr 9, 2024
@Rot127 Rot127 added this to the v6 milestone Apr 9, 2024
@Rot127
Copy link
Collaborator

Rot127 commented Apr 9, 2024

I'll fix those with the LLVM 18 update. Until than, please disable the warnings. It doesn't have an impact on the disassembly quality.

@arkup
Copy link
Contributor Author

arkup commented Apr 9, 2024

I'll fix those with the LLVM 18 update. Until than, please disable the warnings. It doesn't have an impact on the disassembly quality.

Thanks, I disable the errors (Project / Properties / C/C++ / General / SDL Checks - No) and capstone_static build succeeded.
However, when I attempted to build capstone_dll immediately after, it failed with other issues

1>   Creating library capstone-next\msvc\x64\Release\capstone_dll.lib and object capstone-next\msvc\x64\Release\capstone_dll.exp

1>AArch64BaseInfo.obj : error LNK2001: unresolved external symbol binsearch_IndexTypeStrEncoding
1>AArch64BaseInfo.obj : error LNK2001: unresolved external symbol binsearch_IndexTypeEncoding
1>AArch64Disassembler.obj : error LNK2001: unresolved external symbol AArch64_testFeatureList
1>AArch64Disassembler.obj : error LNK2001: unresolved external symbol AArch64_getFeatureBits
1>AArch64InstPrinter.obj : error LNK2001: unresolved external symbol AArch64_add_cs_detail
1>AArch64InstPrinter.obj : error LNK2001: unresolved external symbol AArch64_set_detail_op_imm
1>AArch64InstPrinter.obj : error LNK2001: unresolved external symbol AArch64_set_detail_op_reg
1>AArch64InstPrinter.obj : error LNK2001: unresolved external symbol markup
1>AArch64InstPrinter.obj : error LNK2001: unresolved external symbol getUseMarkup
1>AArch64InstPrinter.obj : error LNK2001: unresolved external symbol matchAliasPatterns
1>ARMDisassembler.obj : error LNK2001: unresolved external symbol isValidCoprocessorNumber
1>ARMDisassembler.obj : error LNK2001: unresolved external symbol VPTBlock_getVPTPred
1>ARMDisassembler.obj : error LNK2001: unresolved external symbol ITBlock_instrLastInITBlock
1>ARMDisassembler.obj : error LNK2001: unresolved external symbol Check
1>ARMDisassembler.obj : error LNK2001: unresolved external symbol ARM_getFeatureBits
1>ARMDisassembler.obj : error LNK2001: unresolved external symbol isVPTOpcode
1>ARMDisassembler.obj : error LNK2001: unresolved external symbol ARM_isCDECoproc
1>ARMDisassembler.obj : error LNK2001: unresolved external symbol VPTBlock_instrInVPTBlock
1>ARMDisassembler.obj : error LNK2001: unresolved external symbol ITBlock_advanceITState
1>ARMDisassembler.obj : error LNK2001: unresolved external symbol ARM_isVpred
1>ARMDisassembler.obj : error LNK2001: unresolved external symbol ITBlock_instrInITBlock
1>ARMDisassembler.obj : error LNK2001: unresolved external symbol ITBlock_setITState
1>ARMDisassembler.obj : error LNK2001: unresolved external symbol VPTBlock_setVPTState
1>ARMDisassembler.obj : error LNK2001: unresolved external symbol ITBlock_getITCC
1>ARMDisassembler.obj : error LNK2001: unresolved external symbol VPTBlock_advanceVPTState
1>ARMInstPrinter.obj : error LNK2001: unresolved external symbol ARMSysReg_lookupMClassSysRegBy12bitSYSmValue
1>ARMInstPrinter.obj : error LNK2001: unresolved external symbol ARMSysReg_lookupMClassSysRegBy8bitSYSmValue
1>ARMInstPrinter.obj : error LNK2001: unresolved external symbol ARMSysReg_lookupMClassSysRegAPSRNonDeprecated
1>ARMMapping.obj : error LNK2001: unresolved external symbol ARMSysReg_lookupMClassSysRegByEncoding
1> \capstone-next\msvc\x64\Release\capstone.dll : fatal error LNK1120: 29 unresolved externals
1>Done building project "capstone_dll.vcxproj" -- FAILED.

any idea what could be the issue here?

@Rot127
Copy link
Collaborator

Rot127 commented Apr 10, 2024

Actually, I wasn't aware of the msvc dir. Can you use the cmake to generate it again?
It should work like this (sorry, can't test it myself, because I currently don't have a Windows VM set up to check it quickly).

@arkup
Copy link
Contributor Author

arkup commented Apr 10, 2024

Actually, I wasn't aware of the msvc dir. Can you use the cmake to generate it again? It should work like this (sorry, can't test it myself, because I currently don't have a Windows VM set up to check it quickly).

thx I tried it, but capstone_dll is not in CMakePredefinedTargets (or I don't know how to create/add it). Only capstone_static (.lib) and tests (/tests*/cstool) will be created. Anyway, for now, I took an older Capstone-5 version, MSVC was working there.

@Rot127 Rot127 added the Windows label Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build & packaging Build system and packaging related Windows
Projects
Status: Todo
Development

No branches or pull requests

2 participants