thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Schmit <>
Subject Re: No C++ types output from Thrift compiler on Windows
Date Mon, 21 Sep 2009 05:45:29 GMT
I decided it probably wasn't a build error and just debugged, and thankfully
seem to have found the problem.  Apparently when building with MinGW under
Cygwin, compiler/cpp/ is using the windows function GetFullPathName,
which returns a string full of backslashes.  All of the compiler code is
hardcoded to do rfind for forward-slashes, so it all breaks and produces
paths like "./gen-cpp/c:\temp\thrift\thrift\tutorial\shared_types.h" instead
of "./gen-cpp/shared_types.h".  Once I made replace '\'
with '/' the output worked fine.
Since I'd rather not go through the trouble of trying to set up code
contribution just to fix this minor bug, I'd appreciate it if someone who
works with this code regularly would add something akin to the following to just before "return resolved_path;":

size_t resolved_len = strlen(resolved_path);
for (size_t i = 0; i < resolved_len; ++i) {
  if (resolved_path[i] == '\\')
    resolved_path[i] = '/';

I'd also appreciate if the was updated to say
"after you build, get your non-cygwin-dependent .exe from the hidden '.libs'
directory", since it seems the thrift.exe in the local directory is merely a
cygwin1.dll-using pointer to that and this confused me for the longest time.

I tried sending this earlier with the binary attached, but my mail got
rejected so I assume it's because of the attachment.  If there's a place I
can upload the win32 binary for you all to host I'd be happy to do so.


On Mon, Sep 14, 2009 at 11:38 PM, Bruce Simpson <> wrote:

> Mark Schmit wrote:
>> Did this not go through or do people simply not build on (or care about
>> thrift compiler on) Windows?  Has anyone else encountered similar
>> problems?
>> -Mark
> Give MinGW + MSYS a try. It will not attempt to shim all of the POSIX APIs
> the way Cygwin does, but you might have better luck with it. The MSYS
> developer tools are needed to run configure scripts, and it has a GNU make.
> Have a look at the XORP BUILD_NOTES for step-by-step instructions on
> installing that stack of developer tools. We're not supporting Win32, for
> the moment, in XORP, due to a lack of active maintainership or current
> interest from Microsoft:-
> Scroll down to "Windows Server 2003".
> MinGW applications link directly against the Microsoft C Runtime,
> MSVCRT.DLL, shipped in all versions of Windows since Windows 98. One known
> issue with that DLL is that snprintf() has a very different return value
> from how it is implemented in the popular UNIX-like systems.
> If you need a Win32 Python, try the ActiveState build -- I have had better
> luck with it in the past. good luck!

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message