作者devcc (凱西)
看板C_and_CPP
標題[問題] 找不到函數的函示庫vtysh
時間Fri Nov 25 23:35:58 2022
開發平台(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):
--
有沒有準備好我不知道,
但我已經做了我最好的選擇。
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 36.225.15.64 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1669390562.A.911.html
推 wulouise: 我沒用過,但是為甚麼不是#include <vtysh.h>? 11/25 23:43
出現一樣的錯誤結果
vtysh.c:2:10: fatal error: vtysh.h: No such file or directory
2 | #include <vtysh.h>
| ^~~~~~~~~
compilation terminated.
※ 編輯: devcc (36.225.15.64 臺灣), 11/25/2022 23:48:26
推 wulouise: 先找怎麼裝zebra的package,裝完應該會順便幫你裝header 11/25 23:47
推 wulouise: 你知道你要用的這個header是屬於哪個lib嗎... 11/26 00:11
→ wulouise: apt-get install quagga先試試...看有沒有用過的人能幫 11/26 00:12
→ breeze08: sudo apt install libpacklib1-dev 11/26 01:01
→ Dracarys: 用-v看這lib有沒有在include path吧…… 11/26 18:36
推 lc85301: 小 google 一下應該是 zebra.h 11/28 12:29