当前位置: 首页 > news >正文

深圳品牌型网站建设怎么自己的电脑做网站

深圳品牌型网站建设,怎么自己的电脑做网站,高德地图vr全景导航,网络营销有哪些推广方法什么是JSON JSON是一种轻量级的数据交换格式#xff0c;可读性强、编写简单。键值对组合编写规则#xff0c;键名使用双引号包裹#xff0c;冒号#xff1a;分隔符后面紧跟着数值#xff0c;有两种常用的数据类型是对象和数组。 对象#xff1a;使用花括号{}包裹起来的…什么是JSON JSON是一种轻量级的数据交换格式可读性强、编写简单。键值对组合编写规则键名使用双引号包裹冒号分隔符后面紧跟着数值有两种常用的数据类型是对象和数组。 对象使用花括号{}包裹起来的内容数据结构{“key1”: “value1”, “key2”:“value2” …}key为对象的属性value为对象的值。 数值使用中括号[]包裹起来的内容数据结构{“key”: [“value1”, “value2”, “value3” …]}。   CentOS 7 安装cJSON 库 cJSON Github 地址https://github.com/DaveGamble/cJSON 步骤1首先你需要下载cJSON的源代码。你可以从https://github.com/DaveGamble/cJSON或者源代码官方网站下载。并上传至/usr/local/source_code/   步骤2下载完成后需要将源代码解压可以使用以下命令  [rootlocalhost source_code]# tar -zxvf cJSON-1.7.15.tar.gz步骤3解压后切换到源代码目录  [rootlocalhost source_code]# cd cJSON-1.7.15步骤4生成cJSON动态/静态库执行如下指令  [rootlocalhost cJSON-1.7.15]# mkdir build [rootlocalhost cJSON-1.7.15]# cd build/ [rootlocalhost build]# cmake .. CMake Deprecation Warning at CMakeLists.txt:2 (cmake_minimum_required):Compatibility with CMake 2.8.12 will be removed from a future version ofCMake.Update the VERSION argument min value or use a ...max suffix to tellCMake that the project does not need compatibility with older versions.-- The C compiler identification is GNU 8.3.1 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done ****** [rootlocalhost build]# make make install [ 2%] Building C object CMakeFiles/cjson.dir/cJSON.c.o [ 4%] Linking C shared library libcjson.so [ 4%] Built target cjson [ 6%] Building C object CMakeFiles/cJSON_test.dir/test.c.o [ 8%] Linking C executable cJSON_test [ 8%] Built target cJSON_test [ 11%] Building C object tests/CMakeFiles/unity.dir/unity/src/unity.c.o [ 13%] Linking C static library libunity.a [ 13%] Built target unity [ 15%] Building C object tests/CMakeFiles/print_number.dir/print_number.c.o [ 17%] Linking C executable print_number -- 省略-- [100%] Built target fuzz_main Install the project... -- Install configuration: -- Installing: /usr/local/include/cjson/cJSON.h -- Installing: /usr/local/lib64/pkgconfig/libcjson.pc -- Installing: /usr/local/lib64/libcjson.so.1.7.15 -- Installing: /usr/local/lib64/libcjson.so.1 -- Installing: /usr/local/lib64/libcjson.so -- Installing: /usr/local/lib64/cmake/cJSON/cjson.cmake -- Installing: /usr/local/lib64/cmake/cJSON/cjson-noconfig.cmake -- Installing: /usr/local/lib64/cmake/cJSON/cJSONConfig.cmake -- Installing: /usr/local/lib64/cmake/cJSON/cJSONConfigVersion.cmake遇到的问题及解决办法 编译执行./test_cjson,提示如下截图错误信息 [rootlocalhost cJSON_demo]# ./test_cjson ./test_cjson: error while loading shared libraries: libcjson.so.1: cannot open shared object file: No such file or directory从报错的原因上看本机上没有找到cJOSN类库的静态库/动态库libcjson.so。 首先检查/usr/local/lib 和/usr/local/include 目录中是否包含cjson 静态或动态库可以执行如下指令 ls /usr/local/lib | grep cjson ls /usr/local/include | grep cjson 从上面分组 查询结果可知cjson 没有在/usr/local/lib 库中生成cjson 静态/动态库链接。 再次查看cJOSN 在执行make make install 指令时对应cJSON 静态/动态库生成链接存放目录地址。 从上述截图可知cJSON 静态/动态库被安装到了/usr/local/lib64 目录中。 将/usr/local/lib64 目录添加至本机静态/动态库链接目录文件中执行如下指令 [rootlocalhost cJSON_demo]# cat /etc/ld.so.conf.d/usr-libs.conf /usr/local/lib [rootlocalhost cJSON_demo]# vi /etc/ld.so.conf.d/usr-libs.conf [rootlocalhost ~]# cat /etc/ld.so.conf.d/usr-libs.conf /usr/local/lib /usr/local/lib64 [rootlocalhost cJSON_demo]# sudo ldconfig再次编译执行./test_cjson, Main 函数正确输出。 cJSON快速入门 在/usr/local/source_code 新增 cJSON_demo目录并新增test_cjson.c 文件文件内容如下 #include stdio.h #include stdlib.h #include string.h #include cjson/cJSON.hint main() {cJSON *json NULL;cJSON *node NULL;cJSON *tnode NULL;cJSON *tnode2 NULL;char *json_data NULL;int i, j, size, size2;char *data {\serialNumber\:\212089842348362300\, \\cellularInfo\:\[\{\name\:\ethernet0/0/1\,\\switch\:\0\},\{\name\:\ethernet0/0/2\,\\switch\:\1\},\{\name\:\ethernet0/0/3\,\\switch\:\0\}\],\\family\:[\father\,\mother\,\brother\,\sister\,\somebody\]\};json cJSON_Parse(data);json_data cJSON_Print(json);printf(data: %s\n, json_data);free(json_data);node cJSON_GetObjectItem(json,serialNumber);if(node NULL)printf(serialNumber: no\n);elseprintf(serialNumber: ok\n);node cJSON_GetObjectItem(json, family);if (node NULL)printf(family: no\n);elseprintf(family: ok\n);if (node-type cJSON_Array){printf(family array size is %d\n, cJSON_GetArraySize(node));size cJSON_GetArraySize(node);for (i0; isize; i){tnode cJSON_GetArrayItem(node, i);if (tnode-type cJSON_String)printf(%d: %s\n, i, tnode-valuestring);elseprintf(node type is not string, value %d\n, tnode-type);}}node cJSON_GetObjectItem(json, cellularInfo);if(node NULL)printf(cellularInfo: no\n);elseprintf(cellularInfo: ok\n);if (node-type cJSON_Array){printf(cellularInfo array size is %d\n, cJSON_GetArraySize(node));size cJSON_GetArraySize(node);for (i0; isize; i){tnode cJSON_GetArrayItem(node, i);if (tnode-type cJSON_String)printf(%d: %s\n, i, tnode-valuestring);else if (tnode-type cJSON_Object){size2 cJSON_GetArraySize(tnode);for (j0; jsize2; j){tnode2 cJSON_GetArrayItem(tnode, j);if (tnode2-type cJSON_String)printf(%d-%d: %s\n, i, j, tnode2-valuestring);elseprintf(tnod2 type is err\n);}}elseprintf(node type is not string, value %d\n, tnode-type);}}cJSON_Delete(json);return 0; }编译源码并执行 [rootlocalhost cJSON_demo]# gcc -o test_cjson test_cjson.c -lcjson [rootlocalhost cJSON_demo]# ./test_cjson data: {serialNumber: 212089842348362300,cellularInfo: [{name: ethernet0/0/1,switch: 0}, {name: ethernet0/0/2,switch: 1}, {name: ethernet0/0/3,switch: 0}],family: [father, mother, brother, sister, somebody] } serialNumber: ok family: ok family array size is 5 0: father 1: mother 2: brother 3: sister 4: somebody cellularInfo: ok cellularInfo array size is 3 0-0: ethernet0/0/1 0-1: 0 1-0: ethernet0/0/2 1-1: 1 2-0: ethernet0/0/3 2-1: 0cJSON 参考资料 cJSON Github 官网地址https://github.com/DaveGamble/cJSON cJSON 开发参考: https://zhuanlan.zhihu.com/p/55095477?utm_oi892471685738024960
http://www.pierceye.com/news/362726/

相关文章:

  • v9网站模板学做西点的网站
  • 网站查询空间商工厂生产erp管理系统
  • 365房产南京网站响应式wordpress主题
  • 上海网站建设 app开发佛山黄页企业名录
  • 网站优化文档天津建设厅网站
  • 网站建设自适应网站电商网站运营规划
  • 做网站如何报价泰州建设局网站质监站
  • 做家具网站电影网站做流量吗
  • 免费1级做看网站制作单页网站要网址
  • 网站返回首页怎么做的好看自贡网站优化
  • 自己的网站如何做推广wordpress积分与奖励
  • 产品包装设计网站网站建设 中企动力宜昌
  • 英语营销型网站建设北京pk10网站开发
  • 交换链接适合哪些网站东莞小程序开发制作
  • 医院网站建设网站阿里巴巴网站是用什么技术做的
  • 潍坊 餐饮网站建设淘宝seo优化
  • 樟木头镇网站建设公司WordPress企业响应式主题
  • 怎么给网站做备份呢怎么去建设微信网站
  • 成都各公司网站中小企业网站建设 论文
  • 广告网站建设实训报告做电商从哪里入手
  • 建电子商务网站需要多少钱做网站的简称
  • 制定网站推广方案网络营销网站分析
  • 商城网站系网站 png逐行交错
  • 陕西网站建设陕icp备免费虚拟机安卓
  • 优化教程网站推广排名东莞网站建设推广有哪些
  • 金阳建设集团网站电子商务系统 网站建设
  • 网站建设规模哪里有做app软件开发
  • 建站工具上市手机视频网站设计
  • 代做道具网站做地方门户网站不备案可以吗
  • 电子商务 网站前台功能想做微商怎么找厂家