天天看點

JSON正确的下載下傳網址及編譯

  • 下載下傳
https://github.com/json-c/json-c

在json_object.h中找一下json_object_object_get_ex。沒有找到說明代碼太老,需要用新庫。

  • 依賴庫
sudo apt-get install autoconf automake libtool      
  • 編譯
sh ./autogen.sh
 
./configure
 
make 
 
sudo make install
       
  • 測試

略。

  • 使用注意事項
#包含頭檔案
-I/usr/local/include/json-c
 
#連結so
-L/usr/local/lib -ljson-c