Компиляция Protocol Buffers в VS 2017

400
06 мая 2017, 22:46

Здравствуйте. Не получается использовать Protocol Buffers в VS 2017 (Debug x86). Выводит ошибки.

Порядок произведенных действий.

  1. Скачал protobufcpp-3.3.0 с гитхаба.
  2. Исполнил команды

    c:\protobuf-3.3.0\cmake\build\>mkdir debug & cd debug c:\protobuf-3.3.0\cmake\build\debug>cmake -G "NMake Makefiles" ^ -DCMAKE_BUILD_TYPE=Debug ^ -DCMAKE_INSTALL_PREFIX=../../../../install ^ ../.. ^ -Dprotobuf_BUILD_SHARED_LIBS=ON

    c:\protobuf-3.3.0\cmake\build\debug>nmake & nmake install

  3. Создал c:\install\proto\addressbook.proto

syntax = "proto2"; package tutorial;
message Person {
required string name = 1; required int32 id = 2; optional string email = 3; }

  1. Исполнил команду

    protoc.exe --proto_path=c:\install\proto --error_format=msvs --cpp_out=c:\install\proto c:\install\proto\addressbook.proto

  2. Создал проект в VS 2017, подключил addressbook.pb.h, addressbook.pb.cc

#include"addressbook.pb.h"

   int main()
    {
               tutorial::Person address_book;
               return 0;
    }
  1. В свойствах проекта добавил c/с++ General: C:\protobuf-3.3.0\src;c:\install\include\ Linker General c:\install\bin\ Input libprotobufd.lib

Ошибка

Error LNK2001 unresolved external symbol "class google::protobuf::internal::ExplicitlyConstructed,class std::allocator > > 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) Protobuf C:\Users\cucaracha\Documents\Visual Studio 2017\Projects\Protobuf\Protobuf\addressbook.pb.obj 1

READ ALSO
разбор json c++ eclips

разбор json c++ eclips

Добрый день, помогите разобраться, выдает ошибку - error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second: [-Werror] String...

234
Как работать с Node.js

Как работать с Node.js

Решил тут попробовать написать онлайн-чат с использованием web-сокетов и как раз наткнулся на интересное видео (https://wwwyoutube

428
Как на canvas добавить form с элементами?

Как на canvas добавить form с элементами?

Делаю игру наподобие BrowserQuestЗастрял на форме регистрации игрока

270
Background-color для селекта

Background-color для селекта

Как задать фон селекта в зависимости от выбранного элемента? Например если сделать так

293