As the title says, I have a Windows app written in C++ from which I need to make calls to remote Thrift services, and I'm a bit lost on the subject, to be honest. http://wiki.apache.org/thrift/ThriftInstallationWin32 states that "The Thrift C++ runtime library does not currently work on Windows". Does that mean I'm shit out of luck, or is there a workaround?
-
Someone edited that out because of "possible profanity". Leave my choice of language alone, please. – korona Apr 14 '10 at 11:15
-
@korona SO is a wiki. If you're uncomfortable with other people editing your questions, don't use this site. – user229044 Nov 16 '10 at 17:39
-
Trust me, I'm completely fine with it being a wiki, that's the whole awesomeness of the site. Don't belittle me. I'm against people imposing their morality on others. Feel free to edit facts or clarify things that weren't clear, but leave Jesus out of it. – korona Nov 25 '10 at 15:06
-
@korona ... What does Jesus have to do with *anything* mentioned? Editing a post to maintain the level of *professionalism* expected and required of Stack Overflow users has nothing to do with imposing morality. There is no room for debate here, [Jeff hath spoken](http://meta.stackexchange.com/questions/22232/are-expletives-allowed-in-comments/22233#22233). – user229044 Nov 25 '10 at 20:15
-
Using colorful language in a well established form of expression is considered unprofessional is your universe? Do you only employ robots and cyborgs over there? – korona Mar 15 '11 at 17:25
-
@korona: Did you succeed using it on Windows? The later versions require boost, but still use platform specific things such as pthread, which exist as portable alternatives in boost, such as Boost.Thread. – dalle Mar 19 '11 at 10:04
-
1@dalle: Man this was long ago. I don't think we ended up using Thrift for this, because of the problems with availability on Windows. Sorry. – korona Mar 22 '11 at 10:27
-
1@korona: May I ask what you used instead? I'm currently in a similar situation, and I'm reluctant to use Thrift because of this non-portability. – dalle Mar 22 '11 at 17:36
-
1Sorry to say but I'm not sure what we ended up doing, but I think it was SOAP. I think there's decent SOAP library support for C++. – korona Apr 04 '11 at 16:19
3 Answers
I ported Thrift to Windows/C++ for my own app. Its open-source, so other people are free to make use of it: http://peoplesnote.codeplex.com/SourceControl/list/changesets

- 13,814
- 3
- 48
- 61
It might not be an elegant solution, but at least it should work:
According to the Thrift Wiki there are C#-bindings, but they really should be called .NET-bindings: there is nothing C#-specific about them. So you could implement your communication-library in a C++/CLI dll-library and reference that .dll from your unmanaged code.

- 48,631
- 24
- 141
- 189
That page seems fairly straightforward. They tell you how to make the Thrift compiler but state, in no uncertain terms, that the metacode from it won't compile under Windows.
So, short of getting someone to figure out how to compile it under Windows, you are out of luck.
To be honest, I can't see how that would be that big a deal, especially since Cygwin pretty well provides everything you need for compiling UNIX sources under Windows. I can only suggest they must be using some fairly esoteric UNIX functionality.
There are a number of approaches to take from here:
1/ Since it's entered the Apache Incubator, there may be plans to support Windows (although I can't find any). If it's truly open source and a need is identified, it's likely someone will start porting the runtimes to Windows. You may not be able to wait.
2/ Why the world needed another RPC mechanism is beyond me. But you could use one of the already-existing RPC mechanisms (SUN/ONC) or your own RPC protocol to communicate from you Windows box to a UNIX box, that then forwards the RPC via Thrift. But this is a kludge and I wouldn't do it out of principal.
Other than that, not much else I can suggest, sorry. Best of luck.

- 854,327
- 234
- 1,573
- 1,953