Rush thanks for your reply. You have more than answered my questions.
I suppose my inquiry was a bit mislead. The C++ code generated by Thrift may be 
compilable on Windows - but it would need a reference to the Thrift C++ 
headers/libraries. Without this reference it will fail with errors like "error 
C2065: 'TProtocol' : undeclared identifier". After going over the documentation 
again I became worried that it was not compilable on Windows at all. Even with 
591. You have happily removed this doubt.
About Cygwin you are correct. It is possible to use it to build the Thrift 
compiler. I have taken this approach and have been able to generated Java, C#, 
and C++ code from the .thrift files. But when I try to "make" the C++ library 
found in "thrift/lib/cpp" it gives me an error (error: 
`PTHREAD_MUTEX_RECURSIVE_NP' undeclared). So as far as I know, unless I'm 
making some simple mistake, you cannot build this library from Cygwin.
Like your tech support user I am also using Visual Studio 2008 and came across 
the need to carry out a conversion from 2005. For me this seems to have worked 
fine as well. But I'm still having a small issue building the msvc libraries. 
Its likely a mistake on my part but if you have any suggestions I would 
appreciate it. Initially when I ran configure.js I supplied the following 
arguments
cscript configure.js --with-boost-inc=C:\boost\boost_1_36_0 
--with-boost-lib=C:\boost\boost_1_36_0\lib
but this produced errors when I built the project either in VS or with nmake. 
The errors stated that there were problems resolving zlib. I believe that you 
have documented this library as optional. But I am unsure as to how I can 
exclude it. So I decided to download and use it. But when I supply 
--with-zlib=C:\zlib\ or --with-zlib-inc=C:\zlib\include 
--with-zlib-lib=C:\zlib\lib
I end up with the following cscript output
C:>cscript configure.js --with-boost-inc=C:\boost\boost_1_36_0 
--with-boost-lib=C:\boost\boost_1_36_0\lib --with-zlib=C:\zlib\Check for boost 
version >= 1.36.0 succeeded!
Found Boost libraries for the configuration tuple {win32, shared, debug} 
:boost_date_time-vc71-mt-gd-1_36.libboost_system-vc71-mt-gd-1_36.libboost_thread-vc71-mt-gd-1_36.lib
Found Boost libraries for the configuration tuple {win32, shared, release} 
:boost_date_time-vc71-mt-1_36.libboost_system-vc71-mt-1_36.libboost_thread-vc71-mt-1_36.lib
Found Boost libraries for the configuration tuple {win32, static, debug} 
:libboost_date_time-vc71-mt-gd-1_36.liblibboost_system-vc71-mt-gd-1_36.liblibboost_thread-vc71-mt-gd-1_36.lib
Found Boost libraries for the configuration tuple {win32, static, release} 
:libboost_date_time-vc71-mt-1_36.liblibboost_system-vc71-mt-1_36.liblibboost_thread-vc71-mt-1_36.lib
ERROR: Could not find any required Zlib libraries for       the configuration 
tuple {win32, shared, debug}
ERROR: Could not find any required Zlib libraries for       the configuration 
tuple {win32, shared, release}
ERROR: Could not find any required Zlib libraries for       the configuration 
tuple {win32, static, debug}
ERROR: Could not find any required Zlib libraries for       the configuration 
tuple {win32, static, release}

Do you know what could be producing these errors? I think I've setup zlib 
correctly and am pointing at the right directory/directories. i.e. I download 
the binary version of zlib 1.2.3 and extracted it to C:\zlib\. Note: I also 
copied zlib1.dll to both System or System32 but this had no effect.
PS: I'm glad to help you increase the successful trials count. The patch is a 
sensible addition to Thrift and should make it more accessible to the general 
audience.
Kind regardsShane

> From: r...@manbert.com
> Subject: Re: ThriftMsvcPatch - Make the C++ runtime library be compatible 
> with Windows and Visual Studio
> Date: Thu, 31 Dec 2009 13:18:36 -0800
> To: thrift-user@incubator.apache.org
> 
> Hi Shane,
> 
> What 591 does is to make the C++ runtime library buildable in Windows using 
> Visual Studio. What it does NOT do is make the compiler buildable using the 
> same mechanism.
> 
> The C++ code that the Thrift compiler generates compiles just fine in 
> Windows.  It runs under Windows as long as you have a runtime library to 
> support it. That's what my patch does for you, it makes the runtime libraries 
> easy to build. You will need to run the Thrift compiler on some other 
> platform (or maybe you can build it using the cygwin libraries in Windows, 
> then run it there. I really don't know because we always run the compiler on 
> a Mac platform, then use the generated code on Mac and Windows. And it might 
> be that if you use Cygwin to be able to build the compiler, then you can also 
> use Cygwin to build and use the libraries. Again, I don't know the details.) 
> Once you have generated the C++ code from the compiler you can bring it into 
> your Visual Studio projects and use it there.
> 
> I have recently (just before Christmas) done some tech support for another 
> C++ user who is using my patched code in Windows. He was using VS 2008, so 
> had to convert all of the VS projects (they were created with VS 2005). His 
> last email to me said that the conversion worked with no problems, that he 
> had built the libraries under VS 2008, and his application was running 
> without problems. As far as I know, he is the first user besides myself.
> 
> I would certainly like to see my code become part of the standard Thrift 
> code. I was waiting for the first release before I started to push for 
> anything. It also seemed good to have a successful user or two. :-) I plan to 
> add my patch to the 0.2 release code, and also to the head of the tree after 
> David Reiss brings in the Facebook modifications, but I'm working on other 
> things at my real job, so have to do that on the side. My employer would also 
> like this code to become part of the distribution, just because it's a pain 
> for us if we have to patch every release that we get.
> 
> Does that answer your questions?
> 
> Best regards,
> Rush
> 
> On Dec 29, 2009, at 2:11 PM, Shane Gannon wrote:
> 
> > 
> > Hi
> > I've being evaluating Thrift for an upcoming project. A critical part of 
> > this evaluation is to determine if Thrift supports C++ on Windows. The 
> > Thrift wiki clearly states on its guide to ThriftUsageC++ "The first thing 
> > you need to know is that the C++ code generated by Thrift compiles only on 
> > Unix based systems".
> > During my research I came across the ThriftMsvcPatch - Make the C++ runtime 
> > library be compatible with Windows and Visual Studio 
> > (http://issues.apache.org/jira/browse/THRIFT-591).
> > This patch, as far as I understand, allows the Thrift C++ runtime library 
> > to be built in Windows with Visual Studio. Up until now I assumed that it 
> > also enabled the C++ code generated by Thrift to be executable on Windows. 
> > Hence it would make Thrift an ideal candidate. But upon re-reading the 
> > description I'm not so sure.
> > Does the msvc patch make Thrift C++ usable in Windows? As opposed to just 
> > making the runtime library buildable? Does it make the C++ code generated 
> > by Thrift compilable in Windows?
> > Or have I misunderstood completely? Is the C++ code generated by Thrift 
> > already runnable on Windows? i.e. It just can't be compiled on Windows.
> > Furthermore will this patch become part of the standard Thrift distribution?
> > PS: Currently my prototyping has only been with C# and Java. For what I've 
> > discovered so far I'm quite happy with Thrift. But my inexperience with C++ 
> > has caused me to delay on a C++ prototype. It may also be the cause of some 
> > mis-conceptions on my part as I'm literally jumping on the C++ fire with 
> > this evaluation.
> > RegardsShane Gannon                                           
> > _________________________________________________________________
> > Windows 7: Simplify what you do everyday. Find the right PC for you.
> > http://windows.microsoft.com/shop
> 
                                          
_________________________________________________________________
Windows 7: Simplify what you do everyday. Find the right PC for you.
http://windows.microsoft.com/shop

Reply via email to