thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shane Gannon <sgannon...@hotmail.com>
Subject RE: ThriftMsvcPatch - Make the C++ runtime library be compatible with Windows and Visual Studio
Date Mon, 04 Jan 2010 23:29:46 GMT

Hey Rush
The errors I'm getting after doing a re-build on the Visual Studio Solution found in C:\thrift-818530-patched\lib\cpp\msvc\libthrift
are:
Error	334	fatal error LNK1104: cannot open file 'thrift-Win32-d.lib'	libthriftnb	libthriftnbError
335	general error c1010070: Failed to load and parse the manifest. The system cannot find
the file specified.	.\Win32\DLL_Debug\dummyLibthriftz.exe.intermediate.manifest	dummyLibthriftzError
338	fatal error C1083: Cannot open include file: 'zlib.h': No such file or directory	c:\thrift-818530-patched\lib\cpp\src\transport\tzlibtransport.cpp
24	libthriftzError	339	fatal error C1083: Cannot open source file: '.': Permission denied
c1xx	libthriftzError	340	general error c10100b1: Failed to load file "..\DLL_Debug\BuildAll.exe".
The system cannot find the path specified.	mt.exe	BuildAll
I also got the last four errors when I did a normal build.
The command
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\ --link=shared --with-zlib-lib-name-pattern[win32][shared][debug]=zdll.lib
--with-zlib-lib-name-pattern[win32][shared][release]=zdll.lib
resulted in a successful build. Thank you for the solution. When I first received the configure.js
error I was tempted to build zlib for source. But in the end I assumed it would make no difference.
Since you say the patch was tested based on the zlib source I'll take this approach in the
future.
After I successfully ran the configure.js script I build libthrift from Visual Studio again.
But I ended up with the same errors. Figuring that it could no longer be a configuration issue
I went back to the zlib documentation. Sure enough there was a set of instructions for using
zlib in Visual Studio that I had missed before. When I added the zlib include and lib directories
to the additional dependencies most my errors disappeared. But two new ones appeared.
I was left with
Error	2	general error c1010070: Failed to load and parse the manifest. The system cannot find
the file specified.	.\Win32\DLL_Debug\dummyLibthriftz.exe.intermediate.manifest	dummyLibthriftzError
4	fatal error LNK1104: cannot open file 'UnknownLibName-not-configured-for_Win32_DLL_Debug.obj'
libthriftz	libthriftzError	5	general error c10100b1: Failed to load file "..\DLL_Debug\BuildAll.exe".
The system cannot find the path specified.	mt.exe	BuildAll
which seem to be more Visual Studio hiccups? Or is something actually missing?
PS: Should I need to add these zlib additional dependencies at all?
RegardsShane
> From: rush@manbert.com
> Subject: Re: ThriftMsvcPatch - Make the C++ runtime library be compatible with Windows
and Visual Studio
> Date: Mon, 4 Jan 2010 11:21:59 -0800
> To: thrift-user@incubator.apache.org
> 
> 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
> > 
> 
 		 	   		  
_________________________________________________________________
New Windows 7: Find the right PC for you. Learn more.
http://windows.microsoft.com/shop
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message