~~~
1>Proxy.obj : error LNK2019: 無法解析的外部符號 __imp__connect@12,該符號在函數 "public: enum ProxyStatus __thiscall CProxy::ConnectProxyServer(unsigned int)" (?ConnectProxyServer@CProxy@@QAE?AW4ProxyStatus@@I@Z) 中被引用
1>Proxy.obj : error LNK2019: 無法解析的外部符號 __imp__ioctlsocket@12,該符號在函數 "public: enum ProxyStatus __thiscall CProxy::ConnectProxyServer(unsigned int)" (?ConnectProxyServer@CProxy@@QAE?AW4ProxyStatus@@I@Z) 中被引用
1>Proxy.obj : error LNK2019: 無法解析的外部符號 __imp__htons@4,該符號在函數 "public: enum ProxyStatus __thiscall CProxy::ConnectProxyServer(unsigned int)" (?ConnectProxyServer@CProxy@@QAE?AW4ProxyStatus@@I@Z) 中被引用
1>Proxy.obj : error LNK2019: 無法解析的外部符號 __imp__inet_addr@4,該符號在函數 "private: enum ProxyStatus __thiscall CProxy::ConnectBySock4(unsigned int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,unsigned short)" (?ConnectBySock4@CProxy@@AAE?AW4ProxyStatus@@IV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@G@Z) 中被引用
1>Proxy.obj : error LNK2019: 無法解析的外部符號 __imp__ntohs@4,該符號在函數 "private: enum ProxyStatus __thiscall CProxy::ConnectBySock4(unsigned int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,unsigned short)" (?ConnectBySock4@CProxy@@AAE?AW4ProxyStatus@@IV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@G@Z) 中被引用
1>Proxy.obj : error LNK2019: 無法解析的外部符號 __imp__recv@16,該符號在函數 "private: int __thiscall CProxy::Receive(unsigned int,char *,int)" (?Receive@CProxy@@AAEHIPADH@Z) 中被引用
1>Proxy.obj : error LNK2019: 無法解析的外部符號 __imp__select@20,該符號在函數 "public: enum ProxyStatus __thiscall CProxy::ConnectProxyServer(unsigned int)" (?ConnectProxyServer@CProxy@@QAE?AW4ProxyStatus@@I@Z) 中被引用
1>Proxy.obj : error LNK2019: 無法解析的外部符號 __imp__send@16,該符號在函數 "private: bool __thiscall CProxy::Send(unsigned int,char const *,int)" (?Send@CProxy@@AAE_NIPBDH@Z) 中被引用
1>Proxy.obj : error LNK2019: 無法解析的外部符號 __imp__setsockopt@20,該符號在函數 "public: enum ProxyStatus __thiscall CProxy::ConnectServer(unsigned int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,unsigned short)" (?ConnectServer@CProxy@@QAE?AW4ProxyStatus@@IV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@G@Z) 中被引用
1>E:\WorkVS2012\SocketProxy\Debug\SocketProxy.exe : fatal error LNK1120: 9 個無法解析的外部命令
1>
1>生成失敗。
~~~
error LNK2019: 無法解析的外部符號??
出現這個錯誤一般都是函數只找到聲明但沒有實現,或者是少了什么鏈接庫,可以試試把那兩個.h和.c文件直接加入工程中再試試,或者是有些函數后面把{}加上。
比如一些函數聲明了,像下面這段代碼:
~~~
class A
{
public:
A();
virtual ~A();
char m_x;
};
~~~
這里面構造函數和析構函數都沒有加上{}。加上即可。
~~~
class A
{
public:
A(){};
virtual ~A(){};
char m_x;
};
~~~
或者你另外實現這個函數。
還有種情況就是沒有添加庫
這種情況下加一句代碼就行了
我遇到的是Socket相關的庫沒加上,我加上下面的部分就對了
~~~
#pragma comment(lib, "ws2_32.lib") ?//這是鏈接API相關連的Ws2_32.lib靜態庫
~~~
一般加在stdafx.h里面就好了
如果出現這種情況就檢查下有沒有這玩意了
LINK?:?fatal?error?LNK1104:?cannot?open?file?"ws32_2.dll"
下面是地址,看看有沒有
C:\Program?Files\Microsoft?Platform?SDK?for?Windows?Server?2003?R2\Bin\Ws2_32.dll
C:\WINDOWS\system32\ws2_32.dll
C:\WINDOWS\system32\dllcache\ws2_32.dll
- 前言
- C++讀取配置文件
- 結構體內存對齊后所占內存空間大小的計算
- do{}while(0)的妙用
- Cocos2dx實現翻牌效果(CCScaleTo與CCOrbitCamera兩種方式)
- C++的error LNK2019: 無法解析的外部符號編譯錯誤
- Java使用JNI調用C++的完整流程
- strupr與strlwr函數的實現
- strcat函數實現
- Windows上VS使用pthread重溫經典多線程賣票(pthreads-w32-2-8-0-release.exe)(windows上使用pthread.h)
- pthread的pthread_join()函數理解實驗
- 順序存儲結構和鏈式存儲結構的選擇
- C語言冒泡排序
- VS看反匯編、寄存器、內存、堆棧調用來學習程序設計
- 快速排序
- C++的構造函數初始化列表
- fatal error C1083: 無法打開包括文件: “SDKDDKVer.h”: No such file or directory
- C++實現簡單的String類