I wanted to run a simple code in c++. Just to try work with JSON file. I'm working in Microsoft VS 2013. I downloaded 'include' folder with header files in, and put it in my current MVS project's folder, it's ok. When I start build my program it says:
- error LNK2019: unresolved external symbol "public: __thiscall Json::Value::Value(enum Json::ValueType)" (??0Value@Json@@QAE@W4ValueType@1@@Z) referenced in function _main C:\Users\Julia\Dropbox\julia\pro\cpp\30\testJson\testJson\Source.obj testJson
- error LNK2019: unresolved external symbol "public: __thiscall Json::Value::~Value(void)" (??1Value@Json@@QAE@XZ) referenced in function _main C:\Users\Julia\Dropbox\julia\pro\cpp\30\testJson\testJson\Source.obj testJson
- error LNK2019: unresolved external symbol "class std::basic_istream > & __cdecl Json::operator>>(class std::basic_istream > &,class Json::Value &)" (??5Json@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@std@@AAV12@AAVValue@0@@Z) referenced in function _main C:\Users\Julia\Dropbox\julia\pro\cpp\30\testJson\testJson\Source.obj testJson
- error LNK2019: unresolved external symbol "class std::basic_ostream > & __cdecl Json::operator<<(class std::basic_ostream > &,class Json::Value const &)" (??6Json@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AAV12@ABVValue@0@@Z) referenced in function _main C:\Users\Julia\Dropbox\julia\pro\cpp\30\testJson\testJson\Source.obj testJson
- error LNK1120: 4 unresolved externals C:\Users\Julia\Dropbox\julia\pro\cpp\30\testJson\Debug\testJson.exe testJson
#include "json/json.h"
#include <iostream>
#include <fstream>
int main()
{
Json::Value root;
std::ifstream file("file.json");
file >> root;
std::cout << root;
}