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

error: reference to 'byte' is ambiguous #176

Closed
jiangyiqi99 opened this issue Jul 31, 2024 · 1 comment
Closed

error: reference to 'byte' is ambiguous #176

jiangyiqi99 opened this issue Jul 31, 2024 · 1 comment

Comments

@jiangyiqi99
Copy link

When I was usingMSYS2 to build in Windows, it appears this issue.
Appears when it execute to "g++ -MMD -MP -DUNTR_VERSION="v366-68a7990-dirty" -isystem./ffmpeg-7.0.1 -std=c++17 -D_FILE_OFFSET_BITS=64 -g -o .build_7.0.1/src/codec.o -c src/codec.cpp"
But the same source code can be successfully made in macOS

src/codec.cpp: In lambda function: src/codec.cpp:451:46: warning: 'AVFrame::key_frame' is deprecated [-Wdeprecated-declarations] 451 | self->was_keyframe_ = frame->key_frame; | ^~~~~~~~~ In file included from ./ffmpeg-7.0.1/libavcodec/avcodec.h:36, from src/codec.cpp:8: ./ffmpeg-7.0.1/libavutil/frame.h:440:9: note: declared here 440 | int key_frame; | ^~~~~~~~~ src/codec.cpp:451:46: warning: 'AVFrame::key_frame' is deprecated [-Wdeprecated-declarations] 451 | self->was_keyframe_ = frame->key_frame; | ^~~~~~~~~ ./ffmpeg-7.0.1/libavutil/frame.h:440:9: note: declared here 440 | int key_frame; | ^~~~~~~~~ src/codec.cpp:451:46: warning: 'AVFrame::key_frame' is deprecated [-Wdeprecated-declarations] 451 | self->was_keyframe_ = frame->key_frame; | ^~~~~~~~~ ./ffmpeg-7.0.1/libavutil/frame.h:440:9: note: declared here 440 | int key_frame; | ^~~~~~~~~ g++ -MMD -MP -DUNTR_VERSION=\"v366-68a7990-dirty\" -isystem./ffmpeg-7.0.1 -std=c++17 -D_FILE_OFFSET_BITS=64 -g -o .build_7.0.1/src/common.o -c src/common.cpp In file included from C:/msys64/mingw64/include/wtypes.h:8, from C:/msys64/mingw64/include/winscard.h:10, from C:/msys64/mingw64/include/windows.h:97, from src/common.cpp:469: C:/msys64/mingw64/include/rpcndr.h:94:11: error: reference to 'byte' is ambiguous 94 | typedef byte cs_byte; | ^~~~ In file included from C:/msys64/mingw64/include/c++/14.1.0/bits/memory_resource.h:38, from C:/msys64/mingw64/include/c++/14.1.0/string:67, from C:/msys64/mingw64/include/c++/14.1.0/bits/locale_classes.h:40, from C:/msys64/mingw64/include/c++/14.1.0/bits/ios_base.h:41, from C:/msys64/mingw64/include/c++/14.1.0/ios:44, from C:/msys64/mingw64/include/c++/14.1.0/ostream:40, from C:/msys64/mingw64/include/c++/14.1.0/iostream:41, from src/common.h:5, from src/common.cpp:1: C:/msys64/mingw64/include/c++/14.1.0/cstddef:70:14: note: candidates are: 'enum class std::byte' 70 | enum class byte : unsigned char {}; | ^~~~ C:/msys64/mingw64/include/rpcndr.h:93:25: note: 'typedef unsigned char byte' 93 | typedef unsigned char byte; | ^~~~ C:/msys64/mingw64/include/rpcndr.h:432:170: error: reference to 'byte' is ambiguous 432 | typedef void (__RPC_API *CS_TYPE_TO_NETCS_ROUTINE)(RPC_BINDING_HANDLE hBinding,unsigned __LONG32 ulNetworkCodeSet,void *pLocalData,unsigned __LONG32 ulLocalDataLength,byte *pNetworkData,unsigned __LONG32 *pulNetworkDataLength,error_status_t *pStatus); | ^~~~ C:/msys64/mingw64/include/c++/14.1.0/cstddef:70:14: note: candidates are: 'enum class std::byte' 70 | enum class byte : unsigned char {}; | ^~~~ C:/msys64/mingw64/include/rpcndr.h:93:25: note: 'typedef unsigned char byte' 93 | typedef unsigned char byte; | ^~~~ C:/msys64/mingw64/include/rpcndr.h:432:170: error: 'byte' has not been declared 432 | typedef void (__RPC_API *CS_TYPE_TO_NETCS_ROUTINE)(RPC_BINDING_HANDLE hBinding,unsigned __LONG32 ulNetworkCodeSet,void *pLocalData,unsigned __LONG32 ulLocalDataLength,byte *pNetworkData,unsigned __LONG32 *pulNetworkDataLength,error_status_t *pStatus); | ^~~~ C:/msys64/mingw64/include/rpcndr.h:433:119: error: reference to 'byte' is ambiguous 433 | typedef void (__RPC_API *CS_TYPE_FROM_NETCS_ROUTINE)(RPC_BINDING_HANDLE hBinding,unsigned __LONG32 ulNetworkCodeSet,byte *pNetworkData,unsigned __LONG32 ulNetworkDataLength,unsigned __LONG32 ulLocalBufferSize,void *pLocalData,unsigned __LONG32 *pulLocalDataLength,error_status_t *pStatus); | ^~~~ C:/msys64/mingw64/include/c++/14.1.0/cstddef:70:14: note: candidates are: 'enum class std::byte' 70 | enum class byte : unsigned char {}; | ^~~~ C:/msys64/mingw64/include/rpcndr.h:93:25: note: 'typedef unsigned char byte' 93 | typedef unsigned char byte; | ^~~~ C:/msys64/mingw64/include/rpcndr.h:433:119: error: 'byte' has not been declared 433 | typedef void (__RPC_API *CS_TYPE_FROM_NETCS_ROUTINE)(RPC_BINDING_HANDLE hBinding,unsigned __LONG32 ulNetworkCodeSet,byte *pNetworkData,unsigned __LONG32 ulNetworkDataLength,unsigned __LONG32 ulLocalBufferSize,void *pLocalData,unsigned __LONG32 *pulLocalDataLength,error_status_t *pStatus); | ^~~~ In file included from C:/msys64/mingw64/include/combaseapi.h:153, from C:/msys64/mingw64/include/objbase.h:14, from C:/msys64/mingw64/include/ole2.h:17, from C:/msys64/mingw64/include/wtypes.h:13: C:/msys64/mingw64/include/wtypesbase.h:327:5: error: reference to 'byte' is ambiguous 327 | byte abData[1]; | ^~~~ C:/msys64/mingw64/include/c++/14.1.0/cstddef:70:14: note: candidates are: 'enum class std::byte' 70 | enum class byte : unsigned char {}; | ^~~~ C:/msys64/mingw64/include/rpcndr.h:93:25: note: 'typedef unsigned char byte' 93 | typedef unsigned char byte; | ^~~~ C:/msys64/mingw64/include/wtypesbase.h:349:5: error: reference to 'byte' is ambiguous 349 | byte abData[1]; | ^~~~ C:/msys64/mingw64/include/c++/14.1.0/cstddef:70:14: note: candidates are: 'enum class std::byte' 70 | enum class byte : unsigned char {}; | ^~~~ C:/msys64/mingw64/include/rpcndr.h:93:25: note: 'typedef unsigned char byte' 93 | typedef unsigned char byte; | ^~~~ C:/msys64/mingw64/include/wtypesbase.h:364:5: error: reference to 'byte' is ambiguous 364 | byte *pData; | ^~~~ C:/msys64/mingw64/include/c++/14.1.0/cstddef:70:14: note: candidates are: 'enum class std::byte' 70 | enum class byte : unsigned char {}; | ^~~~ C:/msys64/mingw64/include/rpcndr.h:93:25: note: 'typedef unsigned char byte' 93 | typedef unsigned char byte; | ^~~~ In file included from C:/msys64/mingw64/include/combaseapi.h:155: C:/msys64/mingw64/include/objidlbase.h:2001:5: error: reference to 'byte' is ambiguous 2001 | byte *pv, | ^~~~ C:/msys64/mingw64/include/c++/14.1.0/cstddef:70:14: note: candidates are: 'enum class std::byte' 70 | enum class byte : unsigned char {}; | ^~~~ C:/msys64/mingw64/include/rpcndr.h:93:25: note: 'typedef unsigned char byte' 93 | typedef unsigned char byte; | ^~~~ C:/msys64/mingw64/include/objidlbase.h:2001:5: error: 'byte' has not been declared 2001 | byte *pv, | ^~~~ C:/msys64/mingw64/include/objidlbase.h:2011:11: error: reference to 'byte' is ambiguous 2011 | const byte *pv, | ^~~~ C:/msys64/mingw64/include/c++/14.1.0/cstddef:70:14: note: candidates are: 'enum class std::byte' 70 | enum class byte : unsigned char {}; | ^~~~ C:/msys64/mingw64/include/rpcndr.h:93:25: note: 'typedef unsigned char byte' 93 | typedef unsigned char byte; | ^~~~ C:/msys64/mingw64/include/objidlbase.h:2026:5: error: reference to 'byte' is ambiguous 2026 | byte *pv, | ^~~~ C:/msys64/mingw64/include/c++/14.1.0/cstddef:70:14: note: candidates are: 'enum class std::byte' 70 | enum class byte : unsigned char {}; | ^~~~ C:/msys64/mingw64/include/rpcndr.h:93:25: note: 'typedef unsigned char byte' 93 | typedef unsigned char byte; | ^~~~ C:/msys64/mingw64/include/objidlbase.h:2026:5: error: 'byte' has not been declared 2026 | byte *pv, | ^~~~ C:/msys64/mingw64/include/objidlbase.h:2036:11: error: reference to 'byte' is ambiguous 2036 | const byte *pv, | ^~~~ C:/msys64/mingw64/include/c++/14.1.0/cstddef:70:14: note: candidates are: 'enum class std::byte' 70 | enum class byte : unsigned char {}; | ^~~~ C:/msys64/mingw64/include/rpcndr.h:93:25: note: 'typedef unsigned char byte' 93 | typedef unsigned char byte; | ^~~~ In file included from C:/msys64/mingw64/include/unknwn.h:55, from C:/msys64/mingw64/include/objidl.h:767, from C:/msys64/mingw64/include/objbase.h:66: C:/msys64/mingw64/include/wtypes.h:54:5: error: reference to 'byte' is ambiguous 54 | byte data[1]; | ^~~~ C:/msys64/mingw64/include/c++/14.1.0/cstddef:70:14: note: candidates are: 'enum class std::byte' 70 | enum class byte : unsigned char {}; | ^~~~ C:/msys64/mingw64/include/rpcndr.h:93:25: note: 'typedef unsigned char byte' 93 | typedef unsigned char byte; | ^~~~ C:/msys64/mingw64/include/wtypes.h:62:5: error: reference to 'byte' is ambiguous 62 | byte data[1]; | ^~~~ C:/msys64/mingw64/include/c++/14.1.0/cstddef:70:14: note: candidates are: 'enum class std::byte' 70 | enum class byte : unsigned char {}; | ^~~~ C:/msys64/mingw64/include/rpcndr.h:93:25: note: 'typedef unsigned char byte' 93 | typedef unsigned char byte; | ^~~~ C:/msys64/mingw64/include/wtypes.h:67:5: error: reference to 'byte' is ambiguous 67 | byte data[1]; | ^~~~ C:/msys64/mingw64/include/c++/14.1.0/cstddef:70:14: note: candidates are: 'enum class std::byte' 70 | enum class byte : unsigned char {}; | ^~~~ C:/msys64/mingw64/include/rpcndr.h:93:25: note: 'typedef unsigned char byte' 93 | typedef unsigned char byte; | ^~~~ C:/msys64/mingw64/include/wtypes.h:71:5: error: reference to 'byte' is ambiguous 71 | byte data[1]; | ^~~~ C:/msys64/mingw64/include/c++/14.1.0/cstddef:70:14: note: candidates are: 'enum class std::byte' 70 | enum class byte : unsigned char {}; | ^~~~ C:/msys64/mingw64/include/rpcndr.h:93:25: note: 'typedef unsigned char byte' 93 | typedef unsigned char byte; | ^~~~ C:/msys64/mingw64/include/wtypes.h:76:5: error: reference to 'byte' is ambiguous 76 | byte data[1]; | ^~~~ C:/msys64/mingw64/include/c++/14.1.0/cstddef:70:14: note: candidates are: 'enum class std::byte' 70 | enum class byte : unsigned char {}; | ^~~~ C:/msys64/mingw64/include/rpcndr.h:93:25: note: 'typedef unsigned char byte' 93 | typedef unsigned char byte; | ^~~~ C:/msys64/mingw64/include/wtypes.h:81:5: error: reference to 'byte' is ambiguous 81 | byte data[1]; | ^~~~ C:/msys64/mingw64/include/c++/14.1.0/cstddef:70:14: note: candidates are: 'enum class std::byte' 70 | enum class byte : unsigned char {}; | ^~~~ C:/msys64/mingw64/include/rpcndr.h:93:25: note: 'typedef unsigned char byte' 93 | typedef unsigned char byte; | ^~~~ C:/msys64/mingw64/include/wtypes.h:307:5: error: reference to 'byte' is ambiguous 307 | byte pBuffer[1]; | ^~~~ C:/msys64/mingw64/include/c++/14.1.0/cstddef:70:14: note: candidates are: 'enum class std::byte' 70 | enum class byte : unsigned char {}; | ^~~~ C:/msys64/mingw64/include/rpcndr.h:93:25: note: 'typedef unsigned char byte' 93 | typedef unsigned char byte; | ^~~~ C:/msys64/mingw64/include/objidl.h:8453:9: error: reference to 'byte' is ambiguous 8453 | byte *pbData, | ^~~~ C:/msys64/mingw64/include/c++/14.1.0/cstddef:70:14: note: candidates are: 'enum class std::byte' 70 | enum class byte : unsigned char {}; | ^~~~ C:/msys64/mingw64/include/rpcndr.h:93:25: note: 'typedef unsigned char byte' 93 | typedef unsigned char byte; | ^~~~ C:/msys64/mingw64/include/objidl.h:8453:9: error: 'byte' has not been declared 8453 | byte *pbData, | ^~~~ C:/msys64/mingw64/include/objidl.h:8961:5: error: reference to 'byte' is ambiguous 8961 | byte *reserved1, | ^~~~ C:/msys64/mingw64/include/c++/14.1.0/cstddef:70:14: note: candidates are: 'enum class std::byte' 70 | enum class byte : unsigned char {}; | ^~~~ C:/msys64/mingw64/include/rpcndr.h:93:25: note: 'typedef unsigned char byte' 93 | typedef unsigned char byte; | ^~~~ C:/msys64/mingw64/include/objidl.h:8961:5: error: 'byte' has not been declared 8961 | byte *reserved1, | ^~~~ C:/msys64/mingw64/include/objidl.h:8985:5: error: reference to 'byte' is ambiguous 8985 | byte *reserved2, | ^~~~ C:/msys64/mingw64/include/c++/14.1.0/cstddef:70:14: note: candidates are: 'enum class std::byte' 70 | enum class byte : unsigned char {}; | ^~~~ C:/msys64/mingw64/include/rpcndr.h:93:25: note: 'typedef unsigned char byte' 93 | typedef unsigned char byte; | ^~~~ C:/msys64/mingw64/include/objidl.h:8985:5: error: 'byte' has not been declared 8985 | byte *reserved2, | ^~~~ C:/msys64/mingw64/include/objidl.h:9004:5: error: reference to 'byte' is ambiguous 9004 | byte *reserved1, | ^~~~ C:/msys64/mingw64/include/c++/14.1.0/cstddef:70:14: note: candidates are: 'enum class std::byte' 70 | enum class byte : unsigned char {}; | ^~~~ C:/msys64/mingw64/include/rpcndr.h:93:25: note: 'typedef unsigned char byte' 93 | typedef unsigned char byte; | ^~~~ C:/msys64/mingw64/include/objidl.h:9004:5: error: 'byte' has not been declared 9004 | byte *reserved1, | ^~~~ C:/msys64/mingw64/include/objidl.h:9030:5: error: reference to 'byte' is ambiguous 9030 | byte *reserved2, | ^~~~ C:/msys64/mingw64/include/c++/14.1.0/cstddef:70:14: note: candidates are: 'enum class std::byte' 70 | enum class byte : unsigned char {}; | ^~~~ C:/msys64/mingw64/include/rpcndr.h:93:25: note: 'typedef unsigned char byte' 93 | typedef unsigned char byte; | ^~~~ C:/msys64/mingw64/include/objidl.h:9030:5: error: 'byte' has not been declared 9030 | byte *reserved2, | ^~~~ C:/msys64/mingw64/include/objidl.h:9485:5: error: reference to 'byte' is ambiguous 9485 | byte *pv, | ^~~~ C:/msys64/mingw64/include/c++/14.1.0/cstddef:70:14: note: candidates are: 'enum class std::byte' 70 | enum class byte : unsigned char {}; | ^~~~ C:/msys64/mingw64/include/rpcndr.h:93:25: note: 'typedef unsigned char byte' 93 | typedef unsigned char byte; | ^~~~ C:/msys64/mingw64/include/objidl.h:9485:5: error: 'byte' has not been declared 9485 | byte *pv, | ^~~~ C:/msys64/mingw64/include/objidl.h:9496:11: error: reference to 'byte' is ambiguous 9496 | const byte *pv, | ^~~~ C:/msys64/mingw64/include/c++/14.1.0/cstddef:70:14: note: candidates are: 'enum class std::byte' 70 | enum class byte : unsigned char {}; | ^~~~ C:/msys64/mingw64/include/rpcndr.h:93:25: note: 'typedef unsigned char byte' 93 | typedef unsigned char byte; | ^~~~ C:/msys64/mingw64/include/objidl.h:9513:5: error: reference to 'byte' is ambiguous 9513 | byte *pv, | ^~~~ C:/msys64/mingw64/include/c++/14.1.0/cstddef:70:14: note: candidates are: 'enum class std::byte' 70 | enum class byte : unsigned char {}; | ^~~~ C:/msys64/mingw64/include/rpcndr.h:93:25: note: 'typedef unsigned char byte' 93 | typedef unsigned char byte; | ^~~~ C:/msys64/mingw64/include/objidl.h:9513:5: error: 'byte' has not been declared 9513 | byte *pv, | ^~~~ C:/msys64/mingw64/include/objidl.h:9525:11: error: reference to 'byte' is ambiguous 9525 | const byte *pv, | ^~~~ C:/msys64/mingw64/include/c++/14.1.0/cstddef:70:14: note: candidates are: 'enum class std::byte' 70 | enum class byte : unsigned char {}; | ^~~~ C:/msys64/mingw64/include/rpcndr.h:93:25: note: 'typedef unsigned char byte' 93 | typedef unsigned char byte; | ^~~~ C:/msys64/mingw64/include/objidl.h:9933:5: error: reference to 'byte' is ambiguous 9933 | byte data[1]; | ^~~~ C:/msys64/mingw64/include/c++/14.1.0/cstddef:70:14: note: candidates are: 'enum class std::byte' 70 | enum class byte : unsigned char {}; | ^~~~ C:/msys64/mingw64/include/rpcndr.h:93:25: note: 'typedef unsigned char byte' 93 | typedef unsigned char byte; | ^~~~ C:/msys64/mingw64/include/objidl.h:11398:11: error: reference to 'byte' is ambiguous 11398 | const byte *pv, | ^~~~ C:/msys64/mingw64/include/c++/14.1.0/cstddef:70:14: note: candidates are: 'enum class std::byte' 70 | enum class byte : unsigned char {}; | ^~~~ C:/msys64/mingw64/include/rpcndr.h:93:25: note: 'typedef unsigned char byte' 93 | typedef unsigned char byte; | ^~~~ C:/msys64/mingw64/include/objidl.h:11409:11: error: reference to 'byte' is ambiguous 11409 | const byte *pv, | ^~~~ C:/msys64/mingw64/include/c++/14.1.0/cstddef:70:14: note: candidates are: 'enum class std::byte' 70 | enum class byte : unsigned char {}; | ^~~~ C:/msys64/mingw64/include/rpcndr.h:93:25: note: 'typedef unsigned char byte' 93 | typedef unsigned char byte; | ^~~~ C:/msys64/mingw64/include/objidl.h:11424:11: error: reference to 'byte' is ambiguous 11424 | const byte *pv, | ^~~~ C:/msys64/mingw64/include/c++/14.1.0/cstddef:70:14: note: candidates are: 'enum class std::byte' 70 | enum class byte : unsigned char {}; | ^~~~ C:/msys64/mingw64/include/rpcndr.h:93:25: note: 'typedef unsigned char byte' 93 | typedef unsigned char byte; | ^~~~ C:/msys64/mingw64/include/objidl.h:11436:11: error: reference to 'byte' is ambiguous 11436 | const byte *pv, | ^~~~ C:/msys64/mingw64/include/c++/14.1.0/cstddef:70:14: note: candidates are: 'enum class std::byte' 70 | enum class byte : unsigned char {}; | ^~~~ C:/msys64/mingw64/include/rpcndr.h:93:25: note: 'typedef unsigned char byte' 93 | typedef unsigned char byte; | ^~~~ In file included from C:/msys64/mingw64/include/msxml.h:311, from C:/msys64/mingw64/include/urlmon.h:458, from C:/msys64/mingw64/include/objbase.h:163: C:/msys64/mingw64/include/oaidl.h:587:5: error: reference to 'byte' is ambiguous 587 | byte *pRecord; | ^~~~ C:/msys64/mingw64/include/c++/14.1.0/cstddef:70:14: note: candidates are: 'enum class std::byte' 70 | enum class byte : unsigned char {}; | ^~~~ C:/msys64/mingw64/include/rpcndr.h:93:25: note: 'typedef unsigned char byte' 93 | typedef unsigned char byte; | ^~~~ make: *** [Makefile:180: .build_7.0.1/src/common.o] Error 1

@jiangyiqi99
Copy link
Author

Sorry, it appears when it execute to "g++ -MMD -MP -DUNTR_VERSION="v366-68a7990-dirty" -isystem./ffmpeg-7.0.1 -std=c++17 -D_FILE_OFFSET_BITS=64 -g -o .build_7.0.1/src/common.o -c src/common.cpp"

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

1 participant