Собрал libjson (брал на sf)
Собирал так
make clean SHARED=1 && make SHARED=1 && sudo make install SHARED=1
Все собралось. Сделал тестовую программку.
#include <iostream>
#include "libjson/libjson.h"
using namespace std;
int main(void) {
JSONNode n(JSON_NODE);
n.push_back(JSONNode("RootA", "Hello World"));
JSONNode c(JSON_ARRAY);
c.set_name("ArrayOfNumbers");
c.push_back(JSONNode("", 16));
c.push_back(JSONNode("", 42));
c.push_back(JSONNode("", 128));
n.push_back(c);
string jc = n.write_formatted();
cout << jc << endl;
return 0;
}
Собираю
g++ json.cpp -o json -ljson
In file included from /usr/include/libjson/libjson.h:4:0,
from json.cpp:2:
/usr/include/libjson/_internal/Source/JSONDefs.h:157:6: warning: #warning , Release build of libjson, but NDEBUG is not on [-Wcpp]
json.cpp: In function ‘int main()’:
json.cpp:7:5: error: ‘JSONNode’ was not declared in this scope
json.cpp:7:14: error: expected ‘;’ before ‘n’
json.cpp:8:5: error: ‘n’ was not declared in this scope
json.cpp:9:14: error: expected ‘;’ before ‘c’
json.cpp:10:5: error: ‘c’ was not declared in this scope
Что за чертовщина? Сборки правильно лежит в /usr/lib/