[問題] 找不到函數的函示庫vtysh

作者: devcc (遊俠)   2022-11-25 23:35:58
開發平台(Platform): (Ex: Win10, Linux, ...)
Win11下的Linux
編譯器(Ex: GCC, clang, VC++...)+目標環境(跟開發平台不同的話需列出)
WSL
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
問題(Question):
我想寫一個能夠用vtysh command來記錄所有cmd
但是函示庫找不到用哪個
不知道我程式哪有問題
餵入的資料(Input):
預期的正確結果(Expected Output):
錯誤結果(Wrong Output):
vtysh.c:2:10: fatal error: zebra.h: No such file or directory
2 | #include <zebra.h>
| ^~~~~~~~~
compilation terminated.
程式碼(Code):(請善用置底文網頁, 記得排版,禁止使用圖檔)
#include <stdio.h>
#include <zebra.h>
int main(int argc,char** argv)
{
char *cmd = argv[1];
vtysh_execute(cmd);
printf("%d , cmd: %s %s\n", argc, cmd, argv[2]);
return 0;
}
補充說明(Supplement):
作者: wulouise (在線上!=在電腦前)   2022-11-25 23:43:00
我沒用過,但是為甚麼不是#include <vtysh.h>?先找怎麼裝zebra的package,裝完應該會順便幫你裝header你知道你要用的這個header是屬於哪個lib嗎...apt-get install quagga先試試...看有沒有用過的人能幫
作者: breeze08 (linuxer)   2022-11-26 01:01:00
sudo apt install libpacklib1-dev
作者: Dracarys (MayShowGunMore)   2022-11-26 18:36:00
用-v看這lib有沒有在include path吧……
作者: lc85301 (pomelocandy)   2022-11-28 12:29:00
小 google 一下應該是 zebra.h

Links booklink

Contact Us: admin [ a t ] ucptt.com