Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用 C/C++ FTP 库(>这里是网站)。当我尝试调用 FtpInit() 函数时,我收到一个编译错误,告诉我有一个undefined reference to _imp__FtpInit. 这就是我要编译的内容:
undefined reference to _imp__FtpInit
#include "ftplib/ftplib.h" int main() { FtpInit(); return 0; }
您是否记得将-L库路径设置为安装库的位置,并使用-lftplib(或类似的,取决于实际库文件的名称)来链接库?
-L
-lftplib
对于 Visual Studio,将 .lib 文件添加到项目属性/链接器/输入中的“附加依赖项”设置。
您可能还需要在项目属性/链接器/常规中设置“附加库目录”