2012-04-08 26 views
6

में संकलित नहीं कर सकता हूं, मुझे हमेशा विजुअल स्टूडियो 2010 में प्रोग्राम संकलित करने में इतनी सारी समस्याएं होती हैं। मैं अपनी हरितता के लिए क्षमा चाहता हूं। मुझे एलएनके त्रुटियां मिल रही हैं और मुझे यकीन नहीं है कि यह उन्हें क्या कर रहा है। मुझे आशा है कि कोई बिल्ड बिल्ड से कुछ स्पॉट करने में सक्षम हो सकता है। शायद कुछ मूर्ख ...मैं विजुअल स्टूडियो 2010

Build started 4/8/2012 3:22:37 PM. 
1>Project "c:\Users\Donald\documents\visual studio 2010\Projects\ClientServer\myClient\myClient.vcxproj" on node 2 (build target(s)). 
1>InitializeBuildStatus: 
    Touching "Debug\myClient.unsuccessfulbuild". 
    ClCompile: 
    c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /ZI /nologo /W3 /WX- /Od /Oy- /D WIN32 /D _DEBUG /D _CONSOLE /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Debug\\" /Fd"Debug\vc100.pdb" /Gd /TP /analyze- /errorReport:prompt mySocket.cpp 
    mySocket.cpp 
1>c:\users\donald\documents\visual studio 2010\projects\clientserver\myclient\mysocket.cpp(1191): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 
      c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' 
    ManifestResourceCompile: 
    C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\rc.exe /nologo /fo"Debug\myClient.exe.embed.manifest.res" Debug\myClient_manifest.rc 
    Link: 
    c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:"c:\users\donald\documents\visual studio 2010\Projects\ClientServer\Debug\myClient.exe" /INCREMENTAL /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /ManifestFile:"Debug\myClient.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"c:\users\donald\documents\visual studio 2010\Projects\ClientServer\Debug\myClient.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"c:\users\donald\documents\visual studio 2010\Projects\ClientServer\Debug\myClient.lib" /MACHINE:X86 Debug\myClient.exe.embed.manifest.res 
    Debug\myClient.obj 
    Debug\myException.obj 
    Debug\myHostInfo.obj 
    Debug\myLog.obj 
    Debug\mySocket.obj 
    Debug\stdafx.obj 
1>myClient.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "public: char * __thiscall myHostInfo::getHostIPAddress(void)" ([email protected]@@QAEPADXZ) 
1>mySocket.obj : error LNK2001: unresolved external symbol [email protected] 
1>myHostInfo.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "public: __thiscall myHostInfo::myHostInfo(void)" ([email protected]@[email protected]) 
1>myHostInfo.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "public: __thiscall myHostInfo::myHostInfo(void)" ([email protected]@[email protected]) 
1>myHostInfo.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "public: __thiscall myHostInfo::myHostInfo(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,enum hostType)" ([email protected]@[email protected][email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@Z) 
1>myHostInfo.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "public: __thiscall myHostInfo::myHostInfo(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,enum hostType)" ([email protected]@[email protected][email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@Z) 
1>mySocket.obj : error LNK2001: unresolved external symbol [email protected] 
1>myHostInfo.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "private: void __thiscall myHostInfo::detectErrorGethostbyname(int *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &)" ([email protected]@@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@Z) 
1>mySocket.obj : error LNK2001: unresolved external symbol [email protected] 
1>mySocket.obj : error LNK2019: unresolved external symbol [email protected] referenced in function [email protected]@[email protected]@Z$0 
1>mySocket.obj : error LNK2019: unresolved external symbol [email protected] referenced in function [email protected]@[email protected]@Z$0 
1>mySocket.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "public: __thiscall mySocket::mySocket(int)" ([email protected]@[email protected]@Z) 
1>mySocket.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "public: virtual __thiscall mySocket::~mySocket(void)" ([email protected]@[email protected]) 
1>mySocket.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "public: void __thiscall mySocket::setDebug(int)" ([email protected]@@[email protected]) 
1>mySocket.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "public: void __thiscall mySocket::setSocketBlocking(int)" ([email protected]@@[email protected]) 
1>mySocket.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "public: int __thiscall mySocket::getDebug(void)" ([email protected]@@QAEHXZ) 
1>mySocket.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "public: virtual __thiscall myTcpSocket::~myTcpSocket(void)" ([email protected]@[email protected]) 
1>mySocket.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "public: static void __cdecl myTcpSocket::initialize(void)" ([email protected]@@SAXXZ) 
1>mySocket.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "public: void __thiscall myTcpSocket::bindSocket(void)" ([email protected]@@QAEXXZ) 
1>mySocket.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "public: virtual void __thiscall myTcpSocket::connectToServer(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,enum hostType)" ([email protected]@@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@Z) 
1>mySocket.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "public: class myTcpSocket * __thiscall myTcpSocket::acceptClient(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &)" ([email protected]@@[email protected][email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@Z) 
1>mySocket.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "public: void __thiscall myTcpSocket::listenToClient(int)" ([email protected]@@[email protected]) 
1>mySocket.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "public: int __thiscall myTcpSocket::sendMessage(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &)" ([email protected]@@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@Z) 
1>mySocket.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "private: int __thiscall myTcpSocket::XPrecieveMessage(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &)" ([email protected]@@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@Z) 
1>c:\users\donald\documents\visual studio 2010\Projects\ClientServer\Debug\myClient.exe : fatal error LNK1120: 21 unresolved externals 
1>Done Building Project "c:\Users\Donald\documents\visual studio 2010\Projects\ClientServer\myClient\myClient.vcxproj" (build target(s)) -- FAILED. 

Build FAILED. 

Time Elapsed 00:00:03.54 

किसी भी मदद की सराहना की जाएगी। कोड पहले ठीक संकलित किया गया है।

+3

एक जटिल कार्यक्रम के साथ शुरू करने के लिए है कि जोड़ने; पहले हैलो वर्ल्ड उदाहरण की तरह कुछ आसान बनाने का प्रयास करें, और देखें कि क्या यह काम करता है। – sarnold

+3

ऐसा लगता है कि आप कम से कम एक पुस्तकालय गायब हैं। 'Gethostbyname' के मेरे प्रश्न के लिए गूगल्स का उत्तर एक एमएसडीएन पृष्ठ था जो इस lib 'Ws2_32.lib' को इंगित करता है। इसे अपने प्रोजेक्ट विकल्पों में जोड़ने की कोशिश करें, या तो सीधे या 'winsock2.h' सहित – DaClown

+0

@ कर्नाल्ड आह हाँ मैं उस बिंदु से ठीक पहले हूं। हैलो वर्ल्ड काम करता है :) मैं इसे DaClown – DonaldH

उत्तर

15

ऊपर पोस्ट की गई त्रुटियों का कहना है कि लिंकर Ws2_32 लाइब्रेरी में शामिल प्रतीकों को नहीं मिला, जिसमें नेटवर्क से संबंधित फ़ंक्शन शामिल हैं।

लिंकर पैरामीटर को यह पुस्तकालय जोड़ने के लिए:

  1. ओपन परियोजना की संपत्ति पेज संवाद बॉक्स। विवरण के लिए, दृश्य सी ++ परियोजना गुणों को सेट करना देखें।
  2. लिंकर फ़ोल्डर पर क्लिक करें।
  3. इनपुट प्रॉपर्टी पेज पर क्लिक करें।
  4. अतिरिक्त निर्भरता संपत्ति संशोधित करें और Ws2_32.lib
+0

उत्कृष्ट प्रतिक्रिया। मैंने एलएनके कोड के लिए Google की कोशिश की लेकिन अगली बार जब मैं Google खोज रहा हूं तो मैं त्रुटि विवरण के साथ और अधिक गहराई से रहूंगा। आपके उत्तर के लिए बहुत बहुत धन्यवाद। इसके अलावा @DaClown – DonaldH

+1

मुझे खुशी है कि मैं मदद कर सकता हूं। – DaClown

संबंधित मुद्दे