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

Windows and "error C2872: 'byte' : ambiguous symbol" #447

Closed
noloader opened this issue Jul 23, 2017 · 1 comment
Closed

Windows and "error C2872: 'byte' : ambiguous symbol" #447

noloader opened this issue Jul 23, 2017 · 1 comment

Comments

@noloader
Copy link
Collaborator

noloader commented Jul 23, 2017

We are experiencing the following when compiling under Visual Studio 2012 with a Windows Kit installed. test.cpp has a using namespace CryptoPP.

The practical problem for us is, main must not be in a namespace. It looks like we need to proxy main. That is, we provide an global main for C++, and then a CryptoPP::Test::main to avoid using namespace CryptoPP. Also see Windows and "error C2872: 'byte' : ambiguous symbol" on the user list.

2>  test.cpp
2>test.cpp(461): error C2872: 'byte' : ambiguous symbol
2>          could be 'c:\program files (x86)\windows kits\8.0\include\shared\rpcndr.h(164) : unsigned char byte'
2>          or       'c:\users\cryptopp-fork\config.h(203) : CryptoPP::byte'
2>test.cpp(480): error C2872: 'byte' : ambiguous symbol
2>          could be 'c:\program files (x86)\windows kits\8.0\include\shared\rpcndr.h(164) : unsigned char byte'
2>          or       'c:\users\cryptopp-fork\config.h(203) : CryptoPP::byte'
2>test.cpp(566): error C2872: 'byte' : ambiguous symbol
2>          could be 'c:\program files (x86)\windows kits\8.0\include\shared\rpcndr.h(164) : unsigned char byte'
2>          or       'c:\users\cryptopp-fork\config.h(203) : CryptoPP::byte'
2>test.cpp(584): error C2872: 'byte' : ambiguous symbol
2>          could be 'c:\program files (x86)\windows kits\8.0\include\shared\rpcndr.h(164) : unsigned char byte'
2>          or       'c:\users\cryptopp-fork\config.h(203) : CryptoPP::byte'
2>test.cpp(595): error C2872: 'byte' : ambiguous symbol
2>          could be 'c:\program files (x86)\windows kits\8.0\include\shared\rpcndr.h(164) : unsigned char byte'
2>          or       'c:\users\cryptopp-fork\config.h(203) : CryptoPP::byte'
2>test.cpp(618): error C2872: 'byte' : ambiguous symbol
2>          could be 'c:\program files (x86)\windows kits\8.0\include\shared\rpcndr.h(164) : unsigned char byte'
2>          or       'c:\users\cryptopp-fork\config.h(203) : CryptoPP::byte'
2>test.cpp(630): error C2872: 'byte' : ambiguous symbol
2>          could be 'c:\program files (x86)\windows kits\8.0\include\shared\rpcndr.h(164) : unsigned char byte'
2>          or       'c:\users\cryptopp-fork\config.h(203) : CryptoPP::byte'
2>test.cpp(631): error C2872: 'byte' : ambiguous symbol
2>          could be 'c:\program files (x86)\windows kits\8.0\include\shared\rpcndr.h(164) : unsigned char byte'
2>          or       'c:\users\cryptopp-fork\config.h(203) : CryptoPP::byte'
2>test.cpp(632): error C2872: 'byte' : ambiguous symbol
2>          could be 'c:\program files (x86)\windows kits\8.0\include\shared\rpcndr.h(164) : unsigned char byte'
2>          or       'c:\users\cryptopp-fork\config.h(203) : CryptoPP::byte'
2>test.cpp(636): error C2872: 'byte' : ambiguous symbol
2>          could be 'c:\program files (x86)\windows kits\8.0\include\shared\rpcndr.h(164) : unsigned char byte'
2>          or       'c:\users\cryptopp-fork\config.h(203) : CryptoPP::byte'
2>test.cpp(686): error C2872: 'byte' : ambiguous symbol
2>          could be 'c:\program files (x86)\windows kits\8.0\include\shared\rpcndr.h(164) : unsigned char byte'
2>          or       'c:\users\cryptopp-fork\config.h(203) : CryptoPP::byte'
2>test.cpp(687): error C2872: 'byte' : ambiguous symbol
2>          could be 'c:\program files (x86)\windows kits\8.0\include\shared\rpcndr.h(164) : unsigned char byte'
2>          or       'c:\users\cryptopp-fork\config.h(203) : CryptoPP::byte'
2>test.cpp(688): error C2872: 'byte' : ambiguous symbol
2>          could be 'c:\program files (x86)\windows kits\8.0\include\shared\rpcndr.h(164) : unsigned char byte'
2>          or       'c:\users\cryptopp-fork\config.h(203) : CryptoPP::byte'
2>test.cpp(692): error C2872: 'byte' : ambiguous symbol
2>          could be 'c:\program files (x86)\windows kits\8.0\include\shared\rpcndr.h(164) : unsigned char byte'
2>          or       'c:\users\cryptopp-fork\config.h(203) : CryptoPP::byte'
2>test.cpp(863): error C2872: 'byte' : ambiguous symbol
2>          could be 'c:\program files (x86)\windows kits\8.0\include\shared\rpcndr.h(164) : unsigned char byte'
2>          or       'c:\users\cryptopp-fork\config.h(203) : CryptoPP::byte'

Also see Test C++17 byte change with dry runs from various projects

noloader referenced this issue Jul 23, 2017
AppVeyor detected the break but we did not receive the email about it. It looks like we have an AppVeyor configuration problem
noloader referenced this issue Jul 23, 2017
…(Issue 447)

This seems to be a little cleaner than the triage at 00e1337 commit.
@noloader
Copy link
Collaborator Author

Triaged at Commit 00e133745663.

Cleared by proxying main at Commit 34c4c9f1bd6a.

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

No branches or pull requests

1 participant