[ad_1]
मेरा एप्लिकेशन निम्नलिखित संकलन त्रुटियों के साथ सामने आया। त्रुटियाँ दर्शाती हैं कि समस्या मेरी हेडर फ़ाइलों की व्यवस्था में है। कृपया निम्नलिखित त्रुटि संदेशों पर विचार करते हुए मेरे आवेदन में हेडर फ़ाइलों को व्यवस्थित करने का सही तरीका कौन सा है। कृपया ध्यान दें कि मैंने अपने आवेदन में दिखाई गई किसी भी हेडर फ़ाइल को शामिल नहीं किया है। इसे मेरे एप्लिकेशन में शामिल एक या अधिक मुख्य हेडर फ़ाइलों में शामिल किया जाना चाहिए। मेरा मानना है कि विरोधाभासी हेडर निम्नलिखित हैं जो विनमेन में स्थित हैं:
#include <Windows.h> #include <gdiplus.h> #include <Commctrl.h>
और
#include <Gdiplus.h> #include <gdiplusheaders.h> #include <string>
वह किसी अन्य फ़ाइल में स्थित है
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(203,14): error C2872: 'byte': ambiguous symbol 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(202,23): message : could be 'unsigned char byte' 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\cstddef(29,24): message : or 'std::byte' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(975,25): error C2872: 'byte': ambiguous symbol 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(202,23): message : could be 'unsigned char byte' 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\cstddef(29,24): message : or 'std::byte' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(983,25): error C2872: 'byte': ambiguous symbol 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(202,23): message : could be 'unsigned char byte' 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\cstddef(29,24): message : or 'std::byte' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\wtypesbase.h(447,26): error C2872: 'byte': ambiguous symbol 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(202,23): message : could be 'unsigned char byte' 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\cstddef(29,24): message : or 'std::byte' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\wtypesbase.h(472,26): error C2872: 'byte': ambiguous symbol 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(202,23): message : could be 'unsigned char byte' 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\cstddef(29,24): message : or 'std::byte' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\wtypesbase.h(489,26): error C2872: 'byte': ambiguous symbol 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(202,23): message : could be 'unsigned char byte' 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\cstddef(29,24): message : or 'std::byte' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\wtypes.h(85,26): error C2872: 'byte': ambiguous symbol 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(202,23): message : could be 'unsigned char byte' 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\cstddef(29,24): message : or 'std::byte' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\wtypes.h(94,26): error C2872: 'byte': ambiguous symbol 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(202,23): message : could be 'unsigned char byte' 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\cstddef(29,24): message : or 'std::byte' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\wtypes.h(100,26): error C2872: 'byte': ambiguous symbol 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(202,23): message : could be 'unsigned char byte' 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\cstddef(29,24): message : or 'std::byte' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\wtypes.h(106,26): error C2872: 'byte': ambiguous symbol 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(202,23): message : could be 'unsigned char byte' 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\cstddef(29,24): message : or 'std::byte' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\wtypes.h(112,26): error C2872: 'byte': ambiguous symbol 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(202,23): message : could be 'unsigned char byte' 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\cstddef(29,24): message : or 'std::byte' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\wtypes.h(118,26): error C2872: 'byte': ambiguous symbol 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(202,23): message : could be 'unsigned char byte' 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\cstddef(29,24): message : or 'std::byte' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\wtypes.h(493,26): error C2872: 'byte': ambiguous symbol 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(202,23): message : could be 'unsigned char byte' 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\cstddef(29,24): message : or 'std::byte' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\objidlbase.h(2275,79): error C2872: 'byte': ambiguous symbol 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(202,23): message : could be 'unsigned char byte' 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\cstddef(29,24): message : or 'std::byte' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\objidlbase.h(2289,62): error C2872: 'byte': ambiguous symbol 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(202,23): message : could be 'unsigned char byte' 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\cstddef(29,24): message : or 'std::byte' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\objidlbase.h(8492,79): error C2872: 'byte': ambiguous symbol 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(202,23): message : could be 'unsigned char byte' 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\cstddef(29,24): message : or 'std::byte' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\objidlbase.h(8508,62): error C2872: 'byte': ambiguous symbol 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(202,23): message : could be 'unsigned char byte' 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\cstddef(29,24): message : or 'std::byte' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\objidl.h(10444,69): error C2872: 'byte': ambiguous symbol 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(202,23): message : could be 'unsigned char byte' 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\cstddef(29,24): message : or 'std::byte' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\objidl.h(11002,77): error C2872: 'byte': ambiguous symbol 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(202,23): message : could be 'unsigned char byte' 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\cstddef(29,24): message : or 'std::byte' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\objidl.h(11034,77): error C2872: 'byte': ambiguous symbol 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(202,23): message : could be 'unsigned char byte' 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\cstddef(29,24): message : or 'std::byte' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\objidl.h(11542,79): error C2872: 'byte': ambiguous symbol 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(202,23): message : could be 'unsigned char byte' 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\cstddef(29,24): message : or 'std::byte' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\objidl.h(11557,62): error C2872: 'byte': ambiguous symbol 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(202,23): message : could be 'unsigned char byte' 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\cstddef(29,24): message : or 'std::byte' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\objidl.h(12018,26): error C2872: 'byte': ambiguous symbol 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(202,23): message : could be 'unsigned char byte' 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\cstddef(29,24): message : or 'std::byte' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\objidl.h(13832,62): error C2872: 'byte': ambiguous symbol 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(202,23): message : could be 'unsigned char byte' 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\cstddef(29,24): message : or 'std::byte' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\objidl.h(13847,62): error C2872: 'byte': ambiguous symbol 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(202,23): message : could be 'unsigned char byte' 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\cstddef(29,24): message : or 'std::byte' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\objidl.h(15586,79): error C2872: 'byte': ambiguous symbol 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(202,23): message : could be 'unsigned char byte' 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\cstddef(29,24): message : or 'std::byte' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\objidl.h(15602,62): error C2872: 'byte': ambiguous symbol 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(202,23): message : could be 'unsigned char byte' 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\cstddef(29,24): message : or 'std::byte' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\objidl.h(15749,77): error C2872: 'byte': ambiguous symbol 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(202,23): message : could be 'unsigned char byte' 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\cstddef(29,24): message : or 'std::byte' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\objidl.h(15788,77): error C2872: 'byte': ambiguous symbol 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(202,23): message : could be 'unsigned char byte' 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\cstddef(29,24): message : or 'std::byte' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\objidl.h(15805,79): error C2872: 'byte': ambiguous symbol 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(202,23): message : could be 'unsigned char byte' 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\cstddef(29,24): message : or 'std::byte' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\objidl.h(15822,62): error C2872: 'byte': ambiguous symbol 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(202,23): message : could be 'unsigned char byte' 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\cstddef(29,24): message : or 'std::byte' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\objidl.h(16067,62): error C2872: 'byte': ambiguous symbol 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(202,23): message : could be 'unsigned char byte' 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\cstddef(29,24): message : or 'std::byte' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\objidl.h(16086,62): error C2872: 'byte': ambiguous symbol 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\rpcndr.h(202,23): message : could be 'unsigned char byte' 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\cstddef(29,24): message : or 'std::byte' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\oaidl.h(571,26): error C2872: 'byte': ambiguous symbol
मैंने क्या प्रयास किया है:
मैं कल से समस्या का समाधान करने का प्रयास कर रहा हूं। मुझे नहीं लगता कि Google इस समस्या में मदद कर सकता है।
समाधान 1
मुझे gdiplus.h हेडर फ़ाइल थोड़ी समस्याग्रस्त लगी है। मैं इसे लगभग हमेशा पूर्व संकलित हेडर फ़ाइल में उपयोग करता हूं और यह आमतौर पर इस तरह दिखता है:
#define NOMINMAX // this removes the min and max definitions #include <SDKDDKVer.h> // various windows and C RTL headers go here #define _USE_MATH_DEFINES // get PI, e, etc. definitions #include <math.h> #pragma warning( push ) #pragma warning( disable : 4458 ) #include <gdiplus.h> #pragma warning( pop ) #include <vector> #include <string> #include <algorithm> // other STL headers here
अपने कोड के साथ मैं हमेशा चेतावनी स्तर 4 का उपयोग करता हूं और प्रैग्मा चेतावनी 4458 को बंद कर देता है जो आमतौर पर जीडीआई+ हेडर से उत्पन्न होता है। मैं Gdiplus.h को STL हेडर से पहले और विंडोज़ और RTL हेडर के बाद शामिल करता हूँ।
एक और बात: मैंने कभी भी, कभी नहीं डाला using namespace
हेडर फ़ाइल में कथन। उन्हें पूर्ववत नहीं किया जा सकता और आमतौर पर समस्याएं पैदा होती हैं।
समाधान 2
ऐसा लगता है जैसे आपके पास है
using namespace std;
समावेशन से पहले कहीं
[ad_2]
コメント