0

I'm new to protobuf. I did the tutorials proposed by Google and everything was fine. I'm now trying to make my own application working and I get an error that I don't understand.

Error   1   error LNK2019: unresolved external symbol __imp__close referenced in function "public: bool __thiscall google::protobuf::io::FileInputStream::CopyingFileInputStream::Close(void)" (?Close@CopyingFileInputStream@FileInputStream@io@protobuf@google@@QAE_NXZ)  D:\Projets\bin\pb_decoder\libprotobuf.lib(zero_copy_stream_impl.obj)    pb_decoder_pck
Error   2   error LNK2019: unresolved external symbol __imp__read referenced in function "public: virtual int __thiscall google::protobuf::io::FileInputStream::CopyingFileInputStream::Read(void *,int)" (?Read@CopyingFileInputStream@FileInputStream@io@protobuf@google@@UAEHPAXH@Z) D:\Projets\bin\pb_decoder\libprotobuf.lib(zero_copy_stream_impl.obj)    pb_decoder_pck
Error   3   error LNK2019: unresolved external symbol __imp__write referenced in function "public: virtual bool __thiscall google::protobuf::io::FileOutputStream::CopyingFileOutputStream::Write(void const *,int)" (?Write@CopyingFileOutputStream@FileOutputStream@io@protobuf@google@@UAE_NPBXH@Z)  D:\Projets\bin\pb_decoder\libprotobuf.lib(zero_copy_stream_impl.obj)    pb_decoder_pck

I didn't use protobuf in my code for now. The only thing I wrote is

#include "helloworld.pb.h"

and my helloword.proto looks like that :

syntax = "proto3";

message Hello {
  int32 id = 1;
  string name = 2;
}

Any idea about the problem here ?

unresolved symbols sounds like a missing like error to me but the libs are actually here. I found a post on groups.google which was pointing out a problem quite similar to my own issue, but it didn't work for me.

Problem with linking runtime libraries on Windows for C++

Context

  • protobuf version 3.0
  • IDE : Visual Studio 2013

My application is a RTMAPS diagram (sofware quite similar to simulink), in case someone heard about this :)

Thanks guys for your help !

augustin-r
  • 13
  • 6

1 Answers1

0

EDIT :answer is in the question :)

The link I gave in my question is actually the answer to my question. I just didn't correct the files correctly. It is however strange that I'm the only one getting this error on the last version of protobuf (3.0).

Here is the link once again : Problem with linking runtime libraries on Windows for C++

I hope it will be helpful to someone !

augustin-r
  • 13
  • 6