0

I have a protobuf file with below content and generated pb.h & pb.cc files out of them.

Proto file content:

syntax = "proto3";

package person;

message Person{
    string name = 1;
    map<string, string> mp = 2;
}

I have a main.cpp file where i am trying to import generated code however i am getting "Protobuf requires at least C++11" error.

main.cpp content:

#include <string>
#include <map>
#include "./person.pb.h"
using namespace std;

int main() {
  
  string greeting = "bishnu";
  cout << greeting;
  map<string, string> m;
  return 0;
}

I am using macbook, intel chip and Visual Studio Code IDE.

I dont know what the issue is. Can somebody help me get this sorted? Any pointer to right document would also be helpful.

Code Compilation: I am using code runner extension and it's compiling using "g++ main.cpp -o main" command.

Also, Even before compiling i can see error in #incude statement by IDE.

Bishnu
  • 383
  • 4
  • 14

0 Answers0