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

Errors with Visual Studio 2017 #1058

Open
BeagleJoe opened this issue Nov 16, 2024 · 3 comments
Open

Errors with Visual Studio 2017 #1058

BeagleJoe opened this issue Nov 16, 2024 · 3 comments

Comments

@BeagleJoe
Copy link

Version 1.24.0
error C2397: conversion from 'int' to 'uint64_t' requires a narrowing conversion

\al\source.cpp
\alc\alc.cpp
\alc\alconfig.cpp
\alc\backends\wasapi.cpp
\core\converter.cpp

@kcat
Copy link
Owner

kcat commented Nov 17, 2024

Where does that happen? What MSVC version?

@BeagleJoe
Copy link
Author

Where does that happen?
I am trying to build openal-soft from source code. (https://github.com/kcat/openal-soft/archive/refs/tags/1.24.0.tar.gz)

What MSVC version?
Microsoft Visual Studio Community 2017
Version 15.9.57
VisualStudio.15.Release/15.9.57+34031.82

OS is Windows 10

These errors occur during the build: (warnings omitted)

Error C2397 conversion from 'int' to 'uint64_t' requires a narrowing conversion \core\converter.cpp 227
Error C2397 conversion from 'int' to 'size_t' requires a narrowing conversion \alc\backends\wasapi.cpp 2227
Error C2397 conversion from 'int' to 'size_t' requires a narrowing conversion \alc\alconfig.cpp 260
Error C2397 conversion from 'int' to 'size_t' requires a narrowing conversion \alc\alc.cpp 3519
Error C2397 conversion from 'int' to 'size_t' requires a narrowing conversion \alc\alc.cpp 2434
Error C2397 conversion from 'int' to 'uint' requires a narrowing conversion \alc\alc.cpp 1264
Error C2397 conversion from '__int64' to 'uint64_t' requires a narrowing conversion \al\source.cpp 429
Error C2397 conversion from 'int' to 'uint64_t' requires a narrowing conversion \al\source.cpp 429

Hope this helps.

@kcat
Copy link
Owner

kcat commented Nov 17, 2024

Looks like the compiler doesn't like "narrowing" a constexpr value, when the value needs to be known at compile time and it must know it fits in the new type. Are you able to upgrade MSVC? It seems to work with VS 17 (MSVC 19), if you're able to upgrade to at least that.

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

No branches or pull requests

2 participants