詳細訊息請參考 msdn 
造成的因素有很多,這裡記錄解決的方式。
以下錯誤訊息為例。
 

libstrophe.lib(sasl.obj) : error LNK2019: unresolved external symbol _SCRAM_SHA1_ClientKey referenced in function _sasl_scram_sha1
錯誤訊息解釋:

libstrophe.libsasl.objsasl_scram_sha1 函式中存在無法解析的外部符號 SCRAM_SHA1_ClientKey

解決步驟:
1.搜尋 sasl 相關訊息。

通常 sasl.obj 代表存在 sasl 開頭的檔案,因此搜尋專案(libstrophe)中是否存在 sasl 開頭的檔案,經過搜尋之後找到 sasl.c & sasl.h這2個檔案。

2.搜尋 SCRAM_SHA1_ClientKey 相關訊息。

觀察 sasl.c 可以發現在其 sasl_scram_sha1 函式中有呼叫SCRAM_SHA1_ClientKey的動作,e.g.

char *sasl_scram_sha1(xmpp_ctx_t *ctx, const char *challenge,
                      const char *first_bare, const char *jid,
                      const char *password)
{
...
SCRAM_SHA1_ClientKey((uint8_t *)password, strlen(password),
                         (uint8_t *)sval, sval_len, (uint32_t)ival, key);
...
}

 

3.找出 SCRAM_SHA1_ClientKey 的宣告和定義。

在 vs2015 使用 ctrl+shift+f 輸入 scram_sha1_clientkey 搜尋,結果發現SCRAM_SHA1_ClientKey 函式定義在 scram.c,函式宣告在 scram.h。

4.找出 scram.h & scram.c 的位置並加入到該專案中。

手動尋找 libstrophe 專案,發現  scram.c & scram.h 的位置 在 libstrophe-master 資料夾的 src (libstrophe-master/src) 資料夾中,因此在 vs2015 的 Source Files 將 scram.c & scram.h 加入。
完成後重新 build libstrophe 專案,產生的 libstrophe.lib 不會再出現該錯誤。


 
另一種方式是直接 google 錯誤訊息,有時候可以得到快速的解答,e.g.

libstrophe.lib(util.obj) : error LNK2019: unresolved external symbol __imp__timeGetTime@0 referenced in function _time_stamp

直接 google “error LNK2019: unresolved external symbol __imp__timeGetTime@0 referenced in function _time_stamp”
可以找到這篇 http://stackoverflow.com/questions/23408384/visual-studio-2012-error-lnk2019-unresolved-external-symbol-linking-with-stat
簡單的說就是需要加入 winmm.lib
因此在 util.c 直接加入 #pragma comment(lib, “winmm.lib”),就可以解決,e.g.

...
#pragma comment(lib, "winmm.lib")
...

而 #pragma comment(lib, “winmm.lib”) 的詳細內容也請參考 msdn,簡單的說就是連結器會在目的檔(util.obj)放入要搜尋的程式庫(winmm.lib)。