Skip to content

Can't build on latest vs2019, LNK4210 and C2131 #45

@h4nsbr1x

Description

@h4nsbr1x

I've tried cloning and building this in vs2019 and I'm getting the following errors:

3>device_custom.cpp
3>C:\Users\User\source\repos\hvpp\src\hvpp\hvpp\interrupt.h(107,31): error C2131: expression did not evaluate to a constant
3>C:\Users\User\source\repos\hvpp\src\hvpp\hvpp\interrupt.h(107,31): message : failure was caused by a read of an uninitialized symbol
3>C:\Users\User\source\repos\hvpp\src\hvpp\hvpp\interrupt.h(107,31): message : see usage of 'ia32::vmx::interrupt_info_t::<unnamed-tag>::nmi_unblocking'
3>C:\Users\User\source\repos\hvpp\src\hvpp\hvpp\interrupt.h(113,33): error C2131: expression did not evaluate to a constant
3>C:\Users\User\source\repos\hvpp\src\hvpp\hvpp\interrupt.h(113,33): message : failure was caused by a read of an uninitialized symbol
3>C:\Users\User\source\repos\hvpp\src\hvpp\hvpp\interrupt.h(113,33): message : see usage of 'ia32::vmx::interrupt_info_t::<unnamed-tag>::nmi_unblocking'
3>C:\Users\User\source\repos\hvpp\src\hvpp\hvpp\interrupt.h(119,42): error C2131: expression did not evaluate to a constant
3>C:\Users\User\source\repos\hvpp\src\hvpp\hvpp\interrupt.h(119,42): message : failure was caused by a read of an uninitialized symbol
3>C:\Users\User\source\repos\hvpp\src\hvpp\hvpp\interrupt.h(119,42): message : see usage of 'ia32::vmx::interrupt_info_t::<unnamed-tag>::nmi_unblocking'
3>C:\Users\User\source\repos\hvpp\src\hvpp\hvpp\interrupt.h(125,46): error C2131: expression did not evaluate to a constant
3>C:\Users\User\source\repos\hvpp\src\hvpp\hvpp\interrupt.h(125,46): message : failure was caused by a read of an uninitialized symbol
3>C:\Users\User\source\repos\hvpp\src\hvpp\hvpp\interrupt.h(125,46): message : see usage of 'ia32::vmx::interrupt_info_t::<unnamed-tag>::nmi_unblocking'
3>C:\Users\User\source\repos\hvpp\src\hvpp\hvpp\interrupt.h(132,38): error C2131: expression did not evaluate to a constant
3>C:\Users\User\source\repos\hvpp\src\hvpp\hvpp\interrupt.h(132,38): message : failure was caused by a read of an uninitialized symbol
3>C:\Users\User\source\repos\hvpp\src\hvpp\hvpp\interrupt.h(132,38): message : see usage of 'ia32::vmx::interrupt_info_t::<unnamed-tag>::nmi_unblocking'
2>Generating code
2>Finished generating code
2>hvpp.lib(hvpp.cpp.obj) : warning LNK4210: .CRT section exists; there may be unhandled static initializers or terminators
2>LINK : error LNK1218: warning treated as error; no output file generated

The first error seems to be here:

static constexpr auto nmi =
      interrupt_t {
        vmx::interrupt_type::nmi,
        exception_vector::nmi_interrupt
      };

This looks related: https://stackoverflow.com/questions/63558400/vs2019-latest-update-constexpr-expression-did-not-evaluate-to-a-constant-for and if I apply the fix it seems to solve the problem.

As for the second fault, no idea what's causing this (LNK4210)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions