且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

构建库libtorrent debian并将其链接到程序c ++

更新时间:2023-02-14 19:40:06

听起来像您已经编译了该库,但实际上并未将其安装在任何地方.默认情况下, #include 指令在/usr/include 中查找,但是libtorrent标头位于构建库的目录中的某个位置.您需要将库文件安装到系统目录中,或者为编译器提供指向libtorrent构建目录的 -I 选项.(出于相同的原因,链接时您可能还需要 -L 选项.)

Sounds like you've compiled the library but not actually installed it anywhere. An #include directive looks in /usr/include by default, but the libtorrent headers are somewhere in the directory where you built the library. You'll need to either install the library's files into the system directories, or give the compiler an -I option pointing to the libtorrent build directory. (You'll probably also need an -L option when linking, for the same reason.)