test.pb.obj:-1: ошибка: LNK2019: ссылка на неразрешенный внешний символ "class google::protobuf::internal::ExplicitlyConstructed<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > google::protobuf::internal::fixed_address_empty_string" (?fixed_address_empty_string@internal@protobuf@google@@3V?$ExplicitlyConstructed@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@123@A) в функции "public: __thiscall r::RouteList::RouteList(class r::RouteList const &)" (??0RouteList@r@@QAE@ABV01@@Z)
As described in README
Static linking is now the default for the Protocol Buffer libraries. Due to
issues with Win32's use of a separate heap for each DLL, as well as binary
compatibility issues between different versions of MSVC's STL library, it is
recommended that you use static linkage only. However, it is possible to
build libprotobuf and libprotoc as DLLs if you really want. To do this,
do the following:
* Add an additional flag `-Dprotobuf_BUILD_SHARED_LIBS=ON` when invoking cmake
* Follow the same steps as described in the above section.
* When compiling your project, make sure to `#define PROTOBUF_USE_DLLS`.
I tried to insert this #define string to several places, but #define hadn't have any effect.
The last attempt was I made is insert this string to test.pb.h file generated by protoc, and app was built successfully.
But *.pb.h is not a good place to make changes.
Tell me please, where is good place to insert
#define PROTOBUF_USE_DLLS ?