I've been trying for hours to get protobuf to work, but it feels like I've tried every single thing there is to try but I still cannot get it to link without these errors:
LNK2019 unresolved external symbol "public: __thiscall tutorial::Person_PhoneNumber::Person_PhoneNumber(void)" (??0Person_PhoneNumber@tutorial@@QAE@XZ) referenced in function "public: static class tutorial::Person_PhoneNumber * __cdecl google::protobuf::Arena::Create<class tutorial::Person_PhoneNumber>(class google::protobuf::Arena *)" (??$Create@VPerson_PhoneNumber@tutorial@@@Arena@protobuf@google@@SAPAVPerson_PhoneNumber@tutorial@@PAV012@@Z)
LNK2019 unresolved external symbol "public: __thiscall tutorial::Person::Person(void)" (??0Person@tutorial@@QAE@XZ) referenced in function "public: static class tutorial::Person * __cdecl google::protobuf::Arena::Create<class tutorial::Person>(class google::protobuf::Arena *)" (??$Create@VPerson@tutorial@@@Arena@protobuf@google@@SAPAVPerson@tutorial@@PAV012@@Z)
LNK2019 unresolved external symbol "public: __thiscall tutorial::AddressBook::AddressBook(void)" (??0AddressBook@tutorial@@QAE@XZ) referenced in function _main
LNK2019 unresolved external symbol "public: virtual __thiscall tutorial::AddressBook::~AddressBook(void)" (??1AddressBook@tutorial@@UAE@XZ) referenced in function _main
I'm using MS Visual Studio 2015. The library and the header files are included (if I rename the .lib-file, it complains that it can't be found).
I've tried both 2.6.1 and 3.0.0b3 (both protoc and libprotobuf, both self-compiled and not). I've compiled protoc myself and compiled the example .proto file with that, and it still can't compile the example that comes with protobuf. I've compiled both my own project and protobuf in both debug and release modes, and I've copied more or less every setting from the protobuf's own test project to my own, and it doesn't compile.
It feels like I've missed something super simple, but I've googled for hours and I can't find out what I'm doing wrong.
Even a super simple file like the one below generates the same errors.
#include "example.pb.h"
int main()
{
GOOGLE_PROTOBUF_VERIFY_VERSION;
Example ex;
}
What more is there to do/try?