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

Cannot build the project due to errors with C2872: 'byte': ambiguous symbol in rpcndr.h #1561

Open
tungdsefastec opened this issue Nov 15, 2024 · 1 comment
Labels

Comments

@tungdsefastec
Copy link

Summary

I try to include the oneTBB in the Qt Project. I downloaded the package from Intel and installed it in my computer.
When I try to #include"oneapi/tbb.h", it shows errors

Version

2022.0.0

Environment

  • OS name and version: Windows 11
  • Compiler version: MSVC2019 64bit

Build errors:
C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/shared/rpcndr.h::203::-1">C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\shared\rpcndr.h(203): error C2872: 'byte': ambiguous symbol
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\shared\rpcndr.h(202): note: could be 'unsigned char byte'
C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/include/cstddef::28::-1">C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\cstddef(28): note: or 'std::byte'

@dnmokhov
Copy link
Contributor

Thank you for reporting this, @tungdsefastec! OneTBB has Windows-specific declarations that require inclusion of Windows headers. What you reported is a known issue with Windows headers, e.g., discussed here: https://developercommunity.visualstudio.com/t/93889. The link above also mentions several workarounds:

  • include tbb.h (and thus the Windows headers) first (or at least before the code that specifies using namespace std)
  • put #define _HAS_STD_BYTE 0 before any includes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants