I am using visual studio 2008 to run the program.
Yes
I included only the header file I created. I now tried including the
cc file and it is giving me more errors.

This is my program
/
*****************************************************************************************************************************************/

#include "stdafx.h"

#include <iostream>
#include <fstream>
#include "C:\Users\vvankadaru\Documents\Visual Studio 2008\Projects
\vishwa_pb\vishwa_pb\test.pb.h"
#include "C:\Users\vvankadaru\Documents\Visual Studio 2008\Projects
\vishwa_pb\vishwa_pb\test.pb.cc"


using namespace std;



int main()
{
 Person person;
        rectangle r;
        r.geth();


 person.set_id(123);
  person.set_name("Bob");
  person.set_email("b...@example.com");

 fstream out("person.pb", ios::out | ios::binary | ios::trunc);
  person.SerializeToOstream(&out);
  out.close();


  Person person_in;
  fstream in("person.pb", ios::in | ios::binary);
  if (!person_in.ParseFromIstream(&in)) {
    cerr << "Failed to parse person.pb." << endl;
    exit(1);
  }

  cout << "ID: " << person_in.id() << endl;
  cout << "name: " << person_in.name() << endl;
  if (person_in.has_email()) {
    cout << "e-mail: " << person_in.email() << endl;
  }
  return 0;
}

/
*****************************************************************************************************************************************/

On Apr 12, 9:59 pm, Pawel <pawel.vese...@gmail.com> wrote:
> Hi.
>
> You should include the commands you are using to try to compile and
> link.
> It seems that you are not compiling the cc file that protoc created,
> or not including that compiled object file into you linking process.
>
> On Apr 12, 3:56 pm, vishwa <vanka...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hi,
> > I am using protocol buffer and c++ for the 1st time .I come from an
> > ETL world and has less knowledge on programming languages.
>
> [skipped]
>
> > Thx
> > Vishwa
>
> > Error   1       error LNK2019: unresolved external symbol "public: virtual
> > __thiscall Person::~Person(void)" (??1Person@@UAE@XZ) referenced in
> > function _main  vishwa_pb.obj   vishwa_pb

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to