Hi, I am new at c++ and I have a feeling that I am doing something wrong. I decided learn using jsoncpp (http://jsoncpp.sourceforge.net) I downloaded the package and after extracting I see bunch of different folders like: doc, include, src...
include folder contains .h files and src folder includes .cpp files. I simply all copied the files to my Visual Studio project. In main Source.cpp file I included "json/json.h" and everything seemed to be fine.
But when I added some code from the example I got compiling error:
1 2 3 4
Error 2 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\Winten\documents\visual studio 2012\Projects\winhttp3\winhttp3\Source.obj winhttp3
Error 3 error LNK2019: unresolved external symbol "public: __thiscall Json::Value::~Value(void)" (??1Value@Json@@QAE@XZ) referenced in function _main C:\Users\Winten\documents\visual studio 2012\Projects\winhttp3\winhttp3\Source.obj winhttp3
Error 4 error LNK2019: unresolved external symbol "public: __thiscall Json::Reader::Reader(void)" (??0Reader@Json@@QAE@XZ) referenced in function _main C:\Users\Winten\documents\visual studio 2012\Projects\winhttp3\winhttp3\Source.obj winhttp3
What am I doing wrong? There were no .dll files in the packet.
Undefined reference is a linker error.
It's not a compile error. #includes don't help.
You did not define the thing in the error message, you forgot to link the file that defines it, you forgot to link to the library that defines it, or, if it's a static library, you have the wrong order on the linker command line.
Check which one. (Note that some linkers call it an unresolved external)
I found the definitions in `src/lib_json/json_{reader,value}.cpp'