I was using newer run time libraries than VS2003 to build my application,
whilst using VS2003 to build the libraries. Sorry about the confusion.

-Wayne


On Fri, Jun 5, 2009 at 5:03 PM, Kenton Varda <ken...@google.com> wrote:

> You said you were using VS2003.  According to your link, these functions
> were not even "deprecated" until VS2005, and they continue to work fine in
> VS2008.  So I'm confused why you're seeing a problem with this.  I haven't
> heard anyone mention this issue before.  Is it possible your CRT headers
> don't match with the CRT library version that you are linking against?
>
> I am not sure what Microsoft means by "ISO complaint".  The entire win32
> API is not "ISO compliant" but I don't see them adding underscores to all of
> those functions.  It seems to me that they are just trying to discourage
> people from using portable APIs.
>
>
> On Fri, Jun 5, 2009 at 11:18 AM, Wayne Menezes <wayne.mene...@gmail.com>wrote:
>
>> 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<http://msdn.microsoft.com/en-us/library/ms235412%28VS.80%29.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