termbench icon indicating copy to clipboard operation
termbench copied to clipboard

Build fails on Win11 + VS2022

Open elsaco opened this issue 4 years ago • 3 comments

Running build.bat there are 2 warning and 2 errors. Sample error:

termbench.cpp:286:43: error: constant expression evaluates to 17179869184 which cannot be narrowed to type 'size_t' (aka 'unsigned int') [-Wc++11-narrowing]
    {"ManyLine", ManyLine, {1*Meg, 1*Gig, 16*Gig}},
                                          ^~~~~~
termbench.cpp:286:43: note: insert an explicit cast to silence this issue
    {"ManyLine", ManyLine, {1*Meg, 1*Gig, 16*Gig}},
                                          ^~~~~~
                                          static_cast<size_t>( )

How do you build termbench on Win11 + VS2022? Thx.

elsaco avatar Nov 29 '21 03:11 elsaco

This looks like you are using the 32-bit compiler. Use the 64-bit compiler instead.

We can probably just force that value to be a 64-bit value, though, and this would work even on the 32-bit compiler, so, that might be a good idea...

- Casey

cmuratori avatar Nov 29 '21 06:11 cmuratori

Using the 64-bit compiler worked. No errors. Thx!

elsaco avatar Nov 30 '21 19:11 elsaco

I'm going to leave this issue open until I have a chance to check the codebase, though. I believe there is no real reason why the code can't work in 32-bit mode with some slight modifications, so I may just go ahead and do that to avoid requiring a 64-bit compiler for no real reason.

- Casey

cmuratori avatar Nov 30 '21 19:11 cmuratori