1. 程式人生 > >C++的error LNK2019: 無法解析的外部符號編譯錯誤

C++的error LNK2019: 無法解析的外部符號編譯錯誤

1>Proxy.obj : error LNK2019: 無法解析的外部符號 [email protected],該符號在函式 "public: enum ProxyStatus __thiscall CProxy::ConnectProxyServer(unsigned int)" ([email protected]@@[email protected]@[email protected]) 中被引用
1>Proxy.obj : error LNK2019: 無法解析的外部符號 [email protected],該符號在函式 "public: enum ProxyStatus __thiscall CProxy::ConnectProxyServer(unsigned int)" (

[email protected]@@[email protected]@[email protected]) 中被引用
1>Proxy.obj : error LNK2019: 無法解析的外部符號 [email protected],該符號在函式 "public: enum ProxyStatus __thiscall CProxy::ConnectProxyServer(unsigned int)" ([email protected]@@[email protected]@[email protected]) 中被引用
1>Proxy.obj : error LNK2019: 無法解析的外部符號
[email protected]
,該符號在函式 "private: enum ProxyStatus __thiscall CProxy::ConnectBySock4(unsigned int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,unsigned short)" ([email protected]@@[email protected]@[email protected][email protected]
@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]) 中被引用
1>Proxy.obj : error LNK2019: 無法解析的外部符號 [email protected],該符號在函式 "private: enum ProxyStatus __thiscall CProxy::ConnectBySock4(unsigned int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,unsigned short)" ([email protected]@@[email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]) 中被引用
1>Proxy.obj : error LNK2019: 無法解析的外部符號 [email protected],該符號在函式 "private: int __thiscall CProxy::Receive(unsigned int,char *,int)" ([email protected]@@[email protected]) 中被引用
1>Proxy.obj : error LNK2019: 無法解析的外部符號 [email protected],該符號在函式 "public: enum ProxyStatus __thiscall CProxy::ConnectProxyServer(unsigned int)" ([email protected]@@[email protected]@[email protected]) 中被引用
1>Proxy.obj : error LNK2019: 無法解析的外部符號 [email protected],該符號在函式 "private: bool __thiscall CProxy::Send(unsigned int,char const *,int)" ([email protected]@@[email protected]) 中被引用
1>Proxy.obj : error LNK2019: 無法解析的外部符號 [email protected],該符號在函式 "public: enum ProxyStatus __thiscall CProxy::ConnectServer(unsigned int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,unsigned short)" ([email protected]@@[email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]) 中被引用
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++ error LNK2019: 無法解析外部符號 錯誤解決方案

今天在實現類模板特例化的時候遇到一個問題,就是把類模板函式實現放到類的cpp檔案中,然後在main函式中使用這個類的時候,就會出現無法解析的外部符號:函式名(xxxx)等錯誤,那麼出現這個錯誤的原因是什麼呢?原因就是現在的編譯裡不支援模板函式的申明和實現分開,要像上面那樣使用

OpenCv在win下靜態庫的編譯和使用,以及部分無法解析外部符號錯誤解決

這裡演示的是opencv3.4版本的編譯和使用過程。1、靜態庫編譯CMake進行配置,編譯時我選擇build目錄為build-static。其中需要設定選擇安裝目錄,設定   “CMAKE_INSTALL_PREFIX”  為   /build-static/install 

C++的error LNK2019: 無法解析外部符號編譯錯誤

1>Proxy.obj : error LNK2019: 無法解析的外部符號 [email protected],該符號在函式 "public: enum ProxyStatus __thiscall CProxy::ConnectProxyServer(u

C++】error LNK2019: 無法解析外部符號

轉:C++ error LNK2019: 無法解析的外部符號 錯誤解決方案 今天在實現類模板特例化的時候遇到一個問題,就是把類模板函式實現放到類的cpp檔案中,然後在main函式中使用這個類的時候,就會出現無法解析的外部符號:函式名(xxxx)等錯誤,那麼出現這個錯誤的原因是什麼呢? 原

C++】error LNK2019: 無法解析外部符號 [email protected

原因:c語言執行時找不到適當的程式入口函式 解決:對於控制檯應用程式 1.選單中選擇 Project->Properties, 彈出Property Pages視窗 2.在左邊欄中依次選擇:Configuration Properties->C/C++->

Visual Studio 2013 C++ 呼叫mysql錯誤 error LNK2019: 無法解析外部符號
error LNK2019: 無法解析外部符號C++程式設計出現問題的解決辦法)

今天,練習程式設計時,照著書本敲程式碼,居然出現了問題,太詭異了。而且出現的是:error LNK2019: 無法解析的外部符號 這樣詭異的問題,著實困擾了我10分鐘。然後我找到了解決辦法——補充預設不帶引數的建構函式的函式體。 ####################

C專案如何轉C++專案——error LNK2019: 無法解析外部符號 "unsigned int __cdecl

實驗的時候,需要呼叫的庫是C++版本,而進行操作的源專案是C版本,這個時候就需要將C版本的專案轉化為C++。 C語言專案轉化為C++專案還是比較簡單的。 步驟: 把需要修改的.c 檔案直接改成 .cpp。 針對.cpp的報錯進行一一修改,基本是記憶體

【cuda編譯error LNK2019: 無法解析外部符號

vs不認cu檔案,導致無法編譯裡面定義的函式 這是因為建立專案時在配置好cuda環境前添加了cu檔案,此時編譯器不認這些cu檔案。 解決辦法:把所以cu檔案從專案中刪除,配置好專案的cuda環境,再

C++控制檯專案中使用C工程程式碼時的注意,避免出現error LNK2019: 無法解析外部符號

當我們在寫 C++控制檯專案時候,有時用到一些執行緒的演算法程式碼專案,這些程式碼專案是用c寫的。當使用時,需要在c的標頭檔案中標註如下內容,才能使得cpp檔案能夠編譯使用c的函式等,才避免在編譯時候出現error LNK2019: 無法解析的外部符號###,在_main中

VS明明定義了函式卻編譯出錯:error LNK2019: 無法解析外部符號

1>LINK : 沒有找到 E:\VS2008\ASM_C_test\Debug\ASM_C_test.exe 或上一個增量連結沒有生成它;正在執行完全連結 1>ASM_C_test.obj : error LNK2019: 無法解析的外部符號 "void __

C++】error LNK2019: 無法解析外部符號 "public: void __thiscall

出現這個錯誤,應該首先檢視“#include”語句是否包含,或者是否包含正確。符號無法解析意味著編譯器知道有這個符號存在,也就是有宣告,但在連結時,找不到實現程式碼,那麼就去看看報錯的這個函式有沒有實現程式碼。如果它們的確已經有了,還是出現這個錯誤,就把它們重新編譯一下。

ARToolKit編譯error LNK2019: 無法解析外部符號 ___glutInitWithExit@12,該符號在函式 _glutInit_ATEXIT_HACK@8 中被引用 解決辦法

1錯誤: 在批量編譯ARToolKit的時候,老是遇到報以下兩個錯誤: 2解決辦法: 在專案工程屬性–》C/C++ –》前處理器 –》前處理器定義 中新增 GLUT_BUILDING_LIB 3原因: OpenGL沒有配置好

error LNK2019: 無法解析外部符號;fatal error LNK1120: 1 個無法解析外部命令; 可能存在的問題

alt 配置 pan ron ima detail deb 16px 管理 一、問題:使用一個.lib出現如下錯誤 (我使用的環境 vs2012)   error LNK2019: 無法解析的外部符號 _SSL_CTX_new,該符號在函數 _main 中被引用;   fa

錯誤 1 error LNK2019: 無法解析外部符號 "public: __thiscall Distance::Distance(int)" (??0Distance@@QAE@H@Z),該符號在函數 _main 中被引用

his 無法 析構函數 this distance AI sta 語法 解析 錯誤: 錯誤 1 error LNK2019: 無法解析的外部符號 "public: __thiscall Distance::Distance(int)" (??0Distance@@QAE@

Qt error: LNK2019: 無法解析外部符號 解決

按照以下幾個步驟依次執行: 1、確認導包是否正確,尤其自定義的檔案; 2、構建-->清理專案,然後執行 qmake; 3、是否有槽函式宣告,卻沒有實現或刪除; 4、自定義類時,建構函式或者解構函式沒有實現; 特別一點的 5、是否需要修改pro檔案。例如: 使用QPr