创建一个libjson库来链接到xcode [英] creating a libjson library to link to xcode

查看:361
本文介绍了创建一个libjson库来链接到xcode的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为可能的noobish问题提前道歉,但我在互联网上的任何地方找不到这个答案或SO在过去几天的查找。

I apologize in advance for the possibly noobish question but I could not find the answer to this anywhere on the internet or SO for the past few days of looking.

我试图在xcode中创建一个c ++项目,我想使用libjson来解析我的json工作。不幸的是,我一直无法获得环境负荷。我尝试了方向,通过make文件。我跑make安装,并试图轻拂各种开关在这里和那里在make文件。我基本上试图遵循的方向,如一个建议这里:
如何创建一个libJSON库?

I'm trying to create a c++ project in xcode and I want to use libjson to parse my json work. Unfortunately, I have been unable to get the environment load it. I tried the directions and looked through the make file. I ran make install and tried flicking various switches here and there in the make file. I basically tried to follow directions such as the one advised here: How to create a libJSON library?

当我尝试运行make文件时,我一直在运行这个问题,我找不到在线解决方案: / p>

When I try to run the make file I keep running into this issue for which I could not find a solution addressing it online:

/usr/bin/ranlib: file: libjson.a(JSONAllocator.o) has no symbols
/usr/bin/ranlib: file: libjson.a(JSONDebug.o) has no symbols
/usr/bin/ranlib: file: libjson.a(JSONMemory.o) has no symbols
/usr/bin/ranlib: file: libjson.a(JSONNode_Mutex.o) has no symbols
/usr/bin/ranlib: file: libjson.a(JSONPreparse.o) has no symbols
/usr/bin/ranlib: file: libjson.a(libjson.o) has no symbols

没有符号是什么意思?

What does has no symbols mean? how could I compile it otherwise?

一个人建议直接添加库,但我不知道如何完成这些工作,并且不断得到编译错误。

One person suggested adding the libraries directly but I was not sure how to get that done and kept getting compile errors.

我尝试安装macport并成功获得jsoncpp安装,但无法找到libjson作为端口。我想最终使用libjson的c ++风格的接口。

I tried installing macport and successfully got jsoncpp to install but could not find libjson as a port. I want to end up using the c++ style interface for libjson.

我试图让它在XCODE上工作我在2009年早期的macbook intel core 2 duo上有os 10.8.5。

I'm trying to get it to work on XCODE I have os 10.8.5 on an old early 2009 macbook intel core 2 duo.

EDIT:以下是'make install'的输出:

Here is the output of 'make install':

============================================================
libjson version: 7.6.1 target:  OS: Darwin
============================================================
Install header files
mkdir -p /Users/aps/Desktop/libj/include/libjson
cp -f ./*.h /Users/aps/Desktop/libj/include/libjson
mkdir -p /Users/aps/Desktop/libj/include/libjson/_internal/Source
cp -f ./_internal/Source/*.h /Users/aps/Desktop/libj/include/libjson/_internal/Source
cp -r ./_internal/Source/JSONDefs /Users/aps/Desktop/libj/include/libjson/_internal/Source
chmod -R a+r /Users/aps/Desktop/libj/include/libjson
find  /Users/aps/Desktop/libj/include/libjson -type d -exec chmod a+x {} \;
cp -rv _internal/Source/Dependencies/ /Users/aps/Desktop/libj/include/libjson/_internal/Source
_internal/Source/Dependencies/ -> /Users/aps/Desktop/libj/include/libjson/_internal/Source
_internal/Source/Dependencies//libbase64++ -> /Users/aps/Desktop/libj/include/libjson/_internal/Source/libbase64++
_internal/Source/Dependencies//libbase64++/libbase64++.h -> /Users/aps/Desktop/libj/include/libjson/_internal/Source/libbase64++/libbase64++.h
_internal/Source/Dependencies//mempool++ -> /Users/aps/Desktop/libj/include/libjson/_internal/Source/mempool++
_internal/Source/Dependencies//mempool++/mempool.h -> /Users/aps/Desktop/libj/include/libjson/_internal/Source/mempool++/mempool.h
Install header files: Done.
mkdir -p Objects_static
Archive
cd Objects_static ; \
    ar -cvq libjson.a internalJSONNode.o JSONAllocator.o JSONChildren.o JSONDebug.o JSONIterators.o JSONMemory.o JSONNode.o JSONNode_Mutex.o JSONPreparse.o JSONStream.o JSONValidator.o JSONWorker.o JSONWriter.o libjson.o  ; \
    mv -f libjson.a ../
q - internalJSONNode.o
q - JSONAllocator.o
q - JSONChildren.o
q - JSONDebug.o
q - JSONIterators.o
q - JSONMemory.o
q - JSONNode.o
q - JSONNode_Mutex.o
q - JSONPreparse.o
q - JSONStream.o
q - JSONValidator.o
q - JSONWorker.o
q - JSONWriter.o
q - libjson.o
Archive: Done
Install static library
cp -f ./libjson.a /Users/aps/Desktop/libj/lib
Install static library: Done.


推荐答案

项目进入我的xcode项目并构建它。它最终解决了这个问题。我仍然不知道为什么我不能使图书馆,并得到它的工作,但希望我会很快找到以及。

In the end, I tried just copying the entire source project into my xcode project and building it. it ended up solving the issue. I am still not sure why I could not make the library and get it to work but hopefully I will find out soon as well.

这篇关于创建一个libjson库来链接到xcode的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆