हाय मैं QString
करने के लिए एक std::wstring
बदलने की आवश्यकता है और मैंरूपांतरण :: QString को wstring लिंकर त्रुटि फेंकता
std::wstring wideString;
QString qtString = QString::fromStdWString(wideString);
का सबसे स्पष्ट तरीका करने की कोशिश की मैं त्रुटि मिली:
Error 2 error LNK2019: unresolved external symbol
"__declspec(dllimport) public: static class QString __cdecl QString::fromStdWString(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)" ([email protected]@@[email protected][email protected][email protected][email protected]@@[email protected][email protected]@@[email protected]@@Z)
referenced in function
"public: void __thiscall FileHandler::deleteDir(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >&,int,unsigned int,bool,bool)" ([email protected]@@[email protected][email protected][email protected]@@[email protected][email protected]@@[email protected]@[email protected])
filehandler.objError 3 fatal error LNK1120: 1 unresolved externals C:\Users\Documents\Visual Studio 2008\Projects\product_dev\deletefiles\Debug\FileHandler.exe
qstring temp = QString::fromWCharArray(const_cast<wchar_t*>(wideString.c_str()),wideString.size());
एर: मैं भी विधि QString::fromWCharArray
उपयोग करने की कोशिश ROR मैं है
Error 2 error LNK2019: unresolved external symbol
"__declspec(dllimport) public: static class QString __cdecl QString::fromWCharArray(wchar_t const*,int)" ([email protected]@@[email protected][email protected])
referenced in function
"public: void __thiscall FileHandler::deleteDir(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >&,int,unsigned int,bool,bool)" ([email protected]@@[email protected][email protected][email protected]@@[email protected][email protected]@@[email protected]@[email protected])
filehandler.objError 3 fatal error LNK1120: 1 unresolved externals C:\Users\Documents\Visual Studio 2008\Projects\product_dev\deletefiles\Debug\FileHandler.exe 1
मैं कैसे इस समस्या को हल करने के लिए आगे बढ़ना कर मिल सकता है?
I, and a few other people इस त्रुटि को * No * पर सेट विकल्प के साथ मिला। यह इसे * हां * पर सेट कर रहा था जिसे संकलित करने की बात मिल गई, लेकिन यह सुनिश्चित नहीं है कि यह रनटाइम के दौरान भी काम करता है, या वास्तव में क्या बदलता है। – neuviemeporte
@neuviemeporte चाहे विजुअल स्टूडियो सेटिंग "हां" या "नहीं" होनी चाहिए, जो कि क्यूटी लाइब्रेरी को संकलित करते समय उपयोग की गई सेटिंग पर निर्भर करता है। यदि आप निर्भरता वॉकर को फायर करते हैं और लिंकर त्रुटि में टाइप सूची के साथ निर्यात में प्रकार की सूची की तुलना करते हैं तो आपको एक मेलमिच ('wchar_t' बनाम' हस्ताक्षरित शॉर्ट') देखना चाहिए।आपको मिलान करने के लिए अपने आवेदन की सेटिंग समायोजित करना होगा। रन टाइम व्यवहार पर इसका कोई असर नहीं पड़ेगा; यह केवल संकलक को हल करने के लिए लिंकर के लिए एक उचित टाइप की गई आयात प्रविष्टि बनाने के लिए संकलक को निर्देश देता है। – IInspectable
हाय, पुरानी पोस्ट लेकिन मुझे cpprest को जोड़ने के बाद qt निर्माता [qt 5.8.2] में एक ही त्रुटि मिल रही है। मैं क्यूटी निर्माता में ऐसी सेटिंग्स कहां सेट कर सकता हूं? – Hummingbird