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

成都网站建设招标wordpress主题 cms

成都网站建设招标,wordpress主题 cms,wordpress设置标题,传奇网页游戏开服我想使用jsoncpp编写C代码以解析JSON文件.让我解释一下我做了什么.我创建了一个CMakeLists.txt,我创建了一个FindJsoncpp.cmake以及一个简单的c文件来测试jsoncpp.当我使用-I /usr/include / jsoncpp / -ljsoncpp编译没有cmake的C源时,它工作正常.但是当我尝试使用cmake构建它时…我想使用jsoncpp编写C代码以解析JSON文件.让我解释一下我做了什么.我创建了一个CMakeLists.txt,我创建了一个FindJsoncpp.cmake以及一个简单的c文件来测试jsoncpp.当我使用-I /usr/include / jsoncpp / -ljsoncpp编译没有cmake的C源时,它工作正常.但是当我尝试使用cmake构建它时,它找不到我在c源代码中包含的json.h头文件.这是我的CMakeLists.txtcmake_minimum_required (VERSION 2.6)project (Parser)set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/Modules/)include(LibFindMacros)message(----------- trying to find Jsoncpp-------------)find_package(Jsoncpp)if(Jsoncpp_FOUND)message(INFO: we found LibJsoncpp on your pc.)message(Jsoncpp_FOUND ${Jsoncpp_FOUND})message(Jsoncpp_INCLUDE_DIR ${Jsoncpp_INCLUDE_DIR})message(Jsoncpp_LIBRARY ${Jsoncpp_LIBRARY})else(Jsoncpp_FOUND)message(WARNING: we couldnt find LibJsoncpp on your pc. DLC is disabled.)endif(Jsoncpp_FOUND)#set(LIBS ${Jsoncpp_LIBRARY})# Set the include dir variables and the libraries and let libfind_process do the rest.# NOTE: Singular variables for this library, plural for libraries this this lib depends on.set(Jsoncpp_PROCESS_INCLUDES Jsoncpp_INCLUDE_DIR)set(Jsoncpp_PROCESS_LIBS Jsoncpp_LIBRARY)# add the executableadd_executable(jsonparser jsonparser.cpp)这是我写的FindJsoncpp.cmake# - Try to find Jsoncpp# Once done, this will define## Jsoncpp_FOUND - system has Jsoncpp# Jsoncpp_INCLUDE_DIRS - the Jsoncpp include directories# Jsoncpp_LIBRARIES - link these to use Jsoncppinclude(LibFindMacros)# Use pkg-config to get hints about pathslibfind_pkg_check_modules(Jsoncpp_PKGCONF jsoncpp)# Include dirfind_path(Jsoncpp_INCLUDE_DIRNAMES json/json.h# PATHS ./jsoncpp/PATHS ${Jsoncpp_PKGCONF_INCLUDE_DIRS} # /usr/include/jsoncpp/json)# Finally the library itselffind_library(Jsoncpp_LIBRARYNAMES jsoncppPATHS ${Jsoncpp_PKGCONF_LIBRARY_DIRS}# PATH ./jsoncpp/)set(Jsoncpp_PROCESS_INCLUDES Jsoncpp_INCLUDE_DIR)set(Jsoncpp_PROCESS_LIBS Jsoncpp_LIBRARY)libfind_process(Jsoncpp)最后一个名为jsonparser.cpp的简单C代码来测试它#include #include #include using namespace std;void printSongInfo(Json::Value song){std::clogstd::clogstd::clog}int main(){std::ifstream catalogFile(catalog.json);Json::Value root; // will contains the root value after parsing.Json::Reader reader;bool parsingSuccessful reader.parse( catalogFile, root );if ( !parsingSuccessful ){// report to the user the failure and their locations in the document.std::cout Failed to parse configuration\n reader.getFormattedErrorMessages();return 1;}//parsing songsconst Json::Value songs root[songs];for ( int index 0; index songs.size(); index ){ // Iterates over the sequence elements.printSongInfo(songs[index] );}return 0;}当我用下面的命令运行jsonparser.cpp时它工作得很好.g -I/usr/include/jsoncpp/ -ljsoncpp jsonparser.cpp但是当我尝试使用cmake时,我得到了这个错误$~/jsoncppTest/build$cmake ..-- The C compiler identification is GNU 4.7.3-- The CXX compiler identification is GNU 4.7.3-- Check for working C compiler: /usr/bin/cc-- Check for working C compiler: /usr/bin/cc -- works-- Detecting C compiler ABI info-- Detecting C compiler ABI info - done-- Check for working CXX compiler: /usr/bin/c-- Check for working CXX compiler: /usr/bin/c -- works-- Detecting CXX compiler ABI info-- Detecting CXX compiler ABI info - done----------- trying to find Jsoncpp--------------- Found PkgConfig: /usr/bin/pkg-config (found version 0.26)-- checking for module jsoncpp-- found jsoncpp, version 0.6.0-- Found JsoncppINFO: we found LibJsoncpp on your pc.Jsoncpp_FOUNDTRUEJsoncpp_INCLUDE_DIR/usr/include/jsoncppJsoncpp_LIBRARY/usr/lib/libjsoncpp.so-- Configuring done-- Generating done-- Build files have been written to: ~/jsoncppTest/build$~/jsoncppTest/build$makeScanning dependencies of target jsonparser[100%] Building CXX object CMakeFiles/jsonparser.dir/jsonparser.cpp.o~/jsoncppTest/jsonparser.cpp:3:23: fatal error: json/json.h: No such file or directorycompilation terminated.make[2]: *** [CMakeFiles/jsonparser.dir/jsonparser.cpp.o] Error 1make[1]: *** [CMakeFiles/jsonparser.dir/all] Error 2make: *** [all] Error 2它找不到json / json.h头文件,但它之前在cmake中创建了jsoncpp库.我检查了jsoncpp.pc文件,发现了确定.我不知道我做错了什么任何帮助,将不胜感激.我正在使用ubuntu 13.04和multiarch支持.我听说过有关64位编译器的jsoncpp问题,但不知道是不是这样.
http://wiki.neutronadmin.com/news/221745/

相关文章:

  • 实用网站开发沈阳网上房屋备案查询
  • 免费做电子书的网站提供网站建设的公司
  • 哪里有做网站设计产品设计工具
  • 网站建设周期表代理网店童装
  • 大连建设工程信息网站网站广告位价格一般多少
  • 无需域名网站建设网页游戏排行榜前十名田田田田田田田田田田
  • 外贸做企业什么网站新增网站和新增接入
  • 池州网站制作哪家好网站优化工具升上去
  • 互联网网站开发合同范本网站改版需要注意
  • 专业网站建设 公司手机网站自适应布局怎么做
  • 宁波专业做网站的公司哪家好企业网站推广的渠道
  • 广州互助网站开发升降平台找企汇优做网站推广
  • 单位网站制作做钓鱼网站犯法吗
  • 广州网站开发学校集团高端网站
  • 商业案例网站上海cms模板建站
  • 中国热门网站源汇区建设局网站
  • 网站开发者模式有什么用软件开发公司的成本有哪些
  • 教育培训东莞网站建设常平哪里有招计算机网站开发的
  • 装饰网站建设软件下载如何用wordpress插件下载
  • 网站制作时间代码电脑版和手机版网站怎么做
  • 网站视频转码软件杭州公司注册费用
  • 长沙 php企业网站系统wordpress 后台 重定向循环
  • 网站后台怎样推荐图片怎么找到那个网站
  • 上海网站建设专业公司国际贸易综合服务平台
  • 制作流程图的网站wordpress 文件结构
  • 怎么用自己的网站做邮箱企业建站套餐价格表
  • 管理系统网站镇海seo专业优化平台
  • 文山知名网站建设公司wordpress评分中文版
  • jsp做网站黑河做网站的公司
  • 网站建设怎样中英文wordpress 注册会员默认权限