我想使用C/C++ FTP庫(>here's the website)。當我嘗試調用FtpInit()函數時,出現編譯錯誤,告訴我有一個undefined reference to _imp__FtpInit
。這就是我想要編譯:C/C++ ftplib:未定義的引用_imp__FtpInit
#include "ftplib/ftplib.h"
int main()
{
FtpInit();
return 0;
}
我想使用C/C++ FTP庫(>here's the website)。當我嘗試調用FtpInit()函數時,出現編譯錯誤,告訴我有一個undefined reference to _imp__FtpInit
。這就是我想要編譯:C/C++ ftplib:未定義的引用_imp__FtpInit
#include "ftplib/ftplib.h"
int main()
{
FtpInit();
return 0;
}
你記得你-L
庫路徑設置爲您安裝庫中的位置,並使用-lftplib
(或類似視實際庫文件的名稱)鏈接庫?
對於Visual Studio,將.lib文件添加到項目屬性/鏈接器/輸入中的「其他依賴項」設置中。
您可能還需要在項目屬性/鏈接器/常規中設置「其他庫目錄」