C++ Linking Chilkat Linux

Create project folder, for example ~cktest:
cd cktest
Download C++ GCC Chilkat Library: wget https://chilkatdownload.com/
tar xfz ./*.gz
Move include and lib folder to cktest
Create your .cpp program, for example my.cpp
#include <CkJsonObject.h>
#include <iostream>

int ChilkatSample()
CkJsonObject json;
    bool success;
int index = -1;

success = json.AddStringAt(-1,"Title","Pan's Labyrinth");
success = json.AddStringAt(-1,"Director","Guillermo del Toro");
success = json.AddStringAt(-1,"Original_Title","El laberinto del fauno");
success = json.AddIntAt(-1,"Year_Released",2006);

std::cout << json.emit() << "\r\n";

static int s = ChilkatSample();

int main()
std::cout << "Inside main() - dummy things";

To compile: g++ my.cpp -I./include -L./lib -lchilkat-9.5.0 -lresolv -lpthread
To execute, you must copy library to default in your system location (/usr/lib /lib etc.)

Execute: ./a.out


#user@srv:~/C++/cktest# ./a.out
"Title": "Pan's Labyrinth",
"Director": "Guillermo del Toro",
"Original_Title": "El laberinto del fauno",
"Year_Released": 2006


Popular posts from this blog


Mapserver install on Ubuntu 18.04 with Naviserver: