thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rush Manbert <r...@manbert.com>
Subject Re: ThriftMsvcPatch - Make the C++ runtime library be compatible with Windows and Visual Studio
Date Mon, 04 Jan 2010 19:21:59 GMT
More replies inline.

On Jan 4, 2010, at 10:41 AM, Rush Manbert wrote:

> Hi Shane,
> 
> Replies inline.
> 
> On Jan 2, 2010, at 1:26 PM, Shane Gannon wrote:
> 
>> 
>> 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.
> 
> I would be interested to see what errors you are getting when you configure without zlib.
By default, zlib is not used. It only comes into play if you specify one of the --with-zlib
parameters.

I'm still interested in this. Maybe more so now. (See below)

> 
>> 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.
> 
> When I did this, I downloaded the source code package for zlib and built the libraries
myself, and the configure.js script is set up to look for the zlib libraries with the following
names:
> 
> (win32, shared, debug): zlib1d.lib
> (win32, shared, release): zlib1.lib
> (win32, static, debug): zlibd.lib
> (win32, static, release): zlib.lib
> 
> I would guess that the libraries in the binary distribution have some other naming scheme.
The configure script already has some fancy regex stuff to handle the variations in naming
for the Boost libraries. I might need to add the equivalent for zlib.
> 
> So the question to you is this: What files do you see in your c:\zlib\lib directory?

Oh, this sucks. I downloaded the binary distribution zip file from the zlib site. It has only
one version of the library, which I'm guessing is the (win32, shared, release) version. 

I think that can be made to work if you run the configure script with these arguments in addition
to what you had already:
--link=shared
--with-zlib-lib-name-pattern[win32][shared][debug]=zdll.lib
--with-zlib-lib-name-pattern[win32][shared][release]=zdll.lib

This will limit the build to DLL only, and will link both the debug and release builds against
the release version of zlib. I expect that will work.

At runtime you will need to have zlib.dll in a directory that is on your path.

If you want to try this, also add --debug to the configure command line options. It spits
out a ton of stuff, but shows what's going on.

Alternatively, we can try to figure out why your non-zlib build didn't seem to work.

> 
>> 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
> 
> Cool. I'll help you any way that I can.
> 
> - Rush
> 


Mime
View raw message