Skip to content

error C4146: unary minus operator applied to unsigned type, result still unsigned and linker errors on Windows, VS2022 latest version #2193

Open
@ghost

Description

The first problem can be bypassed by disabling the /sdl flag.
The second problem is related to ARMMapping.c at lines 76 and 708. The error is as below:

E0029 expected …\capstone\arch\ARM\ARMMapping.c 76
E0029 expected …\capstone\arch\ARM\ARMMapping.c 708

The static library compiles successfully, however the test project shows linker errors while compiling. Here is the log file when I try to compile test_x86:
Build started... 1>------ Build started: Project: test_x86, Configuration: Release x64 ------ 1>capstone.lib(ARMMapping.obj) : error LNK2001: unresolved external symbol ARMSysReg_lookupMClassSysRegByEncoding 1>capstone.lib(ARMMapping.obj) : error LNK2001: unresolved external symbol ARM_getFeatureBits 1>capstone.lib(ARMMapping.obj) : error LNK2001: unresolved external symbol ARMSysReg_lookupMClassSysRegBy12bitSYSmValue 1>capstone.lib(ARMMapping.obj) : error LNK2001: unresolved external symbol ARMSysReg_lookupMClassSysRegBy8bitSYSmValue 1>capstone.lib(ARMMapping.obj) : error LNK2001: unresolved external symbol ARMSysReg_lookupMClassSysRegAPSRNonDeprecated 1>capstone.lib(PPCInstPrinter.obj) : error LNK2001: unresolved external symbol matchAliasPatterns 1>capstone.lib(AArch64BaseInfo.obj) : error LNK2001: unresolved external symbol binsearch_IndexTypeEncoding 1>capstone.lib(ARMInstPrinter.obj) : error LNK2001: unresolved external symbol binsearch_IndexTypeStrEncoding 1>capstone.lib(ARMInstPrinter.obj) : error LNK2001: unresolved external symbol markup 1>capstone.lib(ARMInstPrinter.obj) : error LNK2001: unresolved external symbol getUseMarkup 1>capstone.lib(ARMDisassembler.obj) : error LNK2001: unresolved external symbol isValidCoprocessorNumber 1>capstone.lib(ARMDisassembler.obj) : error LNK2001: unresolved external symbol VPTBlock_getVPTPred 1>capstone.lib(ARMDisassembler.obj) : error LNK2001: unresolved external symbol ITBlock_instrLastInITBlock 1>capstone.lib(ARMDisassembler.obj) : error LNK2001: unresolved external symbol Check 1>capstone.lib(ARMDisassembler.obj) : error LNK2001: unresolved external symbol isVPTOpcode 1>capstone.lib(ARMDisassembler.obj) : error LNK2001: unresolved external symbol ARM_isCDECoproc 1>capstone.lib(ARMDisassembler.obj) : error LNK2001: unresolved external symbol VPTBlock_instrInVPTBlock 1>capstone.lib(ARMDisassembler.obj) : error LNK2001: unresolved external symbol ITBlock_advanceITState 1>capstone.lib(ARMDisassembler.obj) : error LNK2001: unresolved external symbol ARM_isVpred 1>capstone.lib(ARMDisassembler.obj) : error LNK2001: unresolved external symbol ITBlock_instrInITBlock 1>capstone.lib(ARMDisassembler.obj) : error LNK2001: unresolved external symbol ITBlock_setITState 1>capstone.lib(ARMDisassembler.obj) : error LNK2001: unresolved external symbol VPTBlock_setVPTState 1>capstone.lib(ARMDisassembler.obj) : error LNK2001: unresolved external symbol ITBlock_getITCC 1>capstone.lib(ARMDisassembler.obj) : error LNK2001: unresolved external symbol VPTBlock_advanceVPTState 1>I:\Codes22H2\Trinton_Dependencies\capstone\msvc\x64\Release\test_x86.exe : fatal error LNK1120: 24 unresolved externals 1>Done building project "test_x86.vcxproj" -- FAILED.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions