tags:

views:

65

answers:

1

I downloaded C++ libJSON from this link:

And they suggest me to use it as a library. How can I create library using the code they have provided?

+2  A: 

you must have installed g++ and make in console/terminal just compile it type make, it will produce libjson.a which is shared libary. When you create you C/C++ program you can link it with it g++ -l libjson.a

and in your code include libJSON.h header file.

#include "libJSON.h"

and you can use all functions from that header file.

On windows you must Install MinGW (GNU utilities for Windows), or IDE like DevC++ or Code::Blocks (Code::Blocks use MinGW). You can also use Cygwin unix like environment for windows (but when you compile file in cygwin you can run it only in Cygwin)

In Code::Blocks when you create project you can set additinal library which will be linked with your executable.

jcubic
can you detail the steps to create lib file?
Krishnan
This worked in MAc. Can you guide me how to do it in Windows?
Krishnan
I update my answer.
jcubic