Kenton,
I solved the issue. The problem is that in your source code there are
references to functions read, write and close which are the old POSIX
versions. Microsoft has deprecated these functions in favor of the ISO
compliant ones namely _read _write and _close.  See
http://msdn.microsoft.com/en-us/library/ms235412(VS.80).aspx
I had to change the function calls in zero_copy_stream_impl.cc to use the
newer '_' versions and then the linker errors went away while building my
application. I didnt find any other places where the older references were
being used.

I think you need to update your source to handle this issue.

Thanks,
Wayne

On Thu, Jun 4, 2009 at 7:12 PM, Kenton Varda <ken...@google.com> wrote:

> /MDd is the debug library.  libprotobuf.lib only links against it when
> built in debug mode.  Are you also compiling your app in debug mode?  You
> need to make sure to compile both projects in the same mode.
> Are you able to build the tests that come with the protobuf code?  If so,
> maybe check what's different between the tests project and your project.
>
> Otherwise, I don't have any other ideas.
>
>
> On Thu, Jun 4, 2009 at 3:38 PM, Wayne Menezes <wayne.mene...@gmail.com>wrote:
>
>> Thanks for yoru response!
>>
>> I found that Microsoft Visual Studio was using the /MDd flag while
>> compiling libprotobuf.lib. I changed it to use /MD which is what I am using
>> to build my application. So now both are using the same flags, but I am
>> still seeing the same error. I am linking the application against msvcrt.lib
>> and msvcprt.lib which is what MSDN suggests for the /MD flag.
>>
>>
>> Wayne
>>
>>
>>
>> On Thu, Jun 4, 2009 at 4:50 PM, Kenton Varda <ken...@google.com> wrote:
>>
>>> When you compile your app, are you making sure to use the same C runtime
>>> library against which you compiled libprotobuf?  It looks like it's
>>> complaining about missing functions in the C runtime.
>>>
>>> On Thu, Jun 4, 2009 at 8:58 AM, <wayne.mene...@gmail.com> wrote:
>>>
>>>>
>>>> Hi,
>>>> I am trying to use Google Protocol Buffers run time libraries in my
>>>> application. To use Protocol Buffers, I need to first build the run-
>>>> time libraries for C++ on Windows. I am using Visual Studio 2003.
>>>>
>>>> While linking the libraries into my application I get the following
>>>> errors. Can anyone help me figure out what might be the issue?
>>>>
>>>> libprotobuf.lib(zero_copy_stream_impl.obj) : error LNK2019: unresolved
>>>> external symbol __imp__close referenced in function "int __cdecl
>>>> google::protobuf::io::`anonymous namespace'::close_no_eintr(int)" (?
>>>> close_no_ei...@?
>>>> a0x29e80...@io@proto...@google@@y...@z)
>>>> libprotobuf.lib(zero_copy_stream_impl.obj) : error LNK2019: unresolved
>>>> external symbol __imp__read referenced in function "public: virtual
>>>> int __thiscall
>>>> google::protobuf::io::FileInputStream::CopyingFileInputStream::Read
>>>> (void *,int)" (?
>>>> r...@copyingfileinputstream@fileinputstr...@io@proto...@google
>>>> @@uaehp...@z)
>>>> libprotobuf.lib(zero_copy_stream_impl.obj) : error LNK2019: unresolved
>>>> external symbol __imp__write referenced in function "public: virtual
>>>> bool __thiscall
>>>> google::protobuf::io::FileOutputStream::CopyingFileOutputStream::Write
>>>> (void const *,int)" (?
>>>> wr...@copyingfileoutputstream@fileoutputstr...@io@proto...@google
>>>> @@uae_np...@z)
>>>> >>>>
>>>>
>>>
>>
>

--~--~---------~--~----~------------~-------~--~----~
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