Using Apache Thrift in Windows - c++

I'm interested in compiling Thrift-generated code and linking to the thrift C++ library in a windows environment. Doing some research, I found a few recent links:
1) Thrift Win32 Installation Using Cygwin/MinGW
2) THRIFT-1031 and THRIFT-1123 patches to compile in MS Visual C++
Using #1, I was able to compile a linux library using MinGW, named libthrift.a. But what I would REALLY like to do is be able to generate Thrift code, and compile it IN WINDOWS using a Thrift dll or lib.
In other words, I see how I can use MinGW to compile Thrift code that EXECUTES in Windows. But I want to be able to DEVELOP AND COMPILE code that uses Thrift, in Windows. Is this possible?
If not, I suppose #2 is my only option, but it seems to be still highly in development phase.
Any ideas?

Thrift 0.8 has Visual Studio 2010 projects for the Thrift compilier and library. A number of contributors have put in alot of hard work to support Windows VS development. The 0.8 dev release may be downloaded as a snapshot or via SVN http://thrift.apache.org/download/
I've created projects using Thrift in VS and it works great.

There´s a patch available to copile the thrift runtime with visual studio c++. It would be great if the thift developers put this patch in the main code.
https://issues.apache.org/jira/browse/THRIFT-591

Thrift 0.10.0 has much better support for building on Windows.
Visual Studio projects in the source which is the recommended approach on the official site.
CMake generated Visual Studio C++ projects which is not documented on the official site but turns out to be more convenient.
See Apache Thrift on Windows for detailed steps.

Related

Is there a way to force Visual studio 2017 to accept a CMAKE 2.8.12.2

So I am trying to build a basic C++ project on our university Linux server.
I went and checked the CMake version on the server, it is 2.8.12.2
I love using Visual Studio, so i tried using Visual Studio after SSH into my university server to build a basic hello world program on it.
I got the following message in my Visual Studio 2017:
CMake 3.8.x or above is not available on the remote system. See https://aka.ms/linuxcmakeconfig for more info
Is there a way to forcibly make Visual Studio accept a lower version of CMake 2.8.12.2
I made changes to the CMakeLists.txt as follows:
cmake_minimum_required(VERSION 2.8.12.2).
But still Visual Studio was complaining about not having CMake version 3.8 in the University server.
I've attached the screen shots below:
I was told to use some IDE called CLion. But I know Visual Studio is the better option, having used it all my life in the real world/non-university setting.
TL;DR
No, it's not possible.
Reason
The Visual Studio 2017 documentation states here:
The CMake support in Visual Studio requires server mode support introduced in CMake 3.8.
This means VS requires the cmake-server(7) API to query information like where CMake puts the built binaries, what include paths are used, etc. Without this information, VS would not be able to provide all the useful features of an IDE such as debugging, include path checks/auto-completion, etc. So there is no way, the CMake integration of VS (or any other IDE like CLion) is going to work with an CMake version that does not provide the server mode yet, which is definitely the case for all 2.x versions.
More Background
The server mode was actually introduced in CMake 3.7. I don't know why the VS docs suggest it's 3.8 🤷‍♂️. But I guess that's not an important difference for your case anyway.
Newer versions of Visual Studio (since 2019) even use the more recent cmake-file-api(7) introduced in CMake 3.14 as stated here:
Cmake version 3.14 or later should be installed on the target machine.
The server mode was even deprecated in 3.15 and completely removed in 3.20 in favor of the file-based API.
The VS devs even maintain their own CMake fork: github.com/microsoft/CMake.
This is because the server mode didn't provide them all the information they needed, as stated in their blog:
One of the differences in our CMake fork on github was the backtrace information needed for our Targets View feature inside Visual Studio. Prior to CMake 3.14 we needed the CMake version from our fork, in order for Targets View to work properly. Now, with the file-based API this is no longer required.
So maybe with VS 2017 you should use a CMake binary built by Microsoft. For VS 2019+ the "stock" CMake should probably be fine. As of now, they still maintain their fork, but I haven't found any source that indicates you're required to use it. Probably because Microsoft has become more involved in the CMake development the last couple of years and contributes to the upstream repository as well, e.g. cmake-presets(7) is the result of a cooperation between Microsoft and Kitware.
Recommended Solution
As #Shawn already commented, CMake 2.8.12 is seriously outdated (released 2013-10-08) and the best solution would be to ask the admin of your University to update CMake to a more recent version. This has the additional advantage, that you can use and benefit from the "Modern CMake" techniques.

Where is cl.exe? (MS Build Tools ’13)

I just want the VC++ compiler, since some C++ graphics libraries (I'm planning to use and learn bgfx...) require it for compilation. For this I’ve downloaded and installed Ms. Build Tools ’13. However, I can’t find it.
My attempts:
1) I’ve ran Windows Command Prompt using the Batch input cl and it echoed 'cl'is not recognized as an internal or external command, operable program or batch file..
2) I’ve searched for a file with filename cl.exe on both "C:\Programs Files" and "C:\Programs Files (x86)" paths recursively and nothing. There’s no top folder related to MsVC++ or VC++ too, on the disk.
I cannot try to install Build Tools ’15 (nor VS) since the installer downloads at minimum 3 gygabytes and my network isn’t good.
Where can I find the compiler? Otherwise, is there any cross-platform graphics library (at least for Windows and Mac) that doesn’t need MSVC++ (e.g., just G++), please?
As a commenter mentioned, the Microsoft Build Tools 201x include tools to build managed apps (i.e. .Net apps), not native C++ apps. That's the answer to "where is cl.exe?" It's not there. It was never there.
That's true for the Microsoft Build Tools 2015 too, despite what you think and said. You're mixing up Microsoft Build Tools 2015 and Visual C++ 2015 Build Tools. Note the "C++" there (and the order of some of the words).
The Visual C++ Build Tools are the supported and recommended way by Microsoft to Build visual C++ projects without installing Visual Studio.
If your problem is internet connection get someone else to download it for you, seriously. You're really looking at it the wrong way.
Another alternative is the Enterprise WDK. It's "only" 1.9GB.
Otherwise, is there any cross-platform graphics library (at least for Windows and Mac) that doesn’t need MSVC++
Yes, you should be able to use modern OpenGL in a cross-platform way under Mingw using
GLFW (since it's a CMAKE compile-it-yourself library) and the excellent GLAD for handling loading of the modern openGL API on windows.

Building Emscripten Project with an IDE?

I've recently discovered Emscripten as a way of writing native code and running it in a web browser.
I'd like to work with an IDE for code completion and be able to customize the build process for Emscripten.
The only tool I've found to build Emscripten this way is with VS2010 which has very limited c++11 support so that's not desirable.
I thought of using VS2013 and writing a custom build script but I've never used VS so I'm unsure how to do that or if it's even possible.
What are people using to work with Emscripten?
Not sure if you are aware of this. On the requirements page, the following is stated:
Visual Studio 2010 is required! Visual Studio 2012 and Visual Studio 2013 do not correctly compile Fastcomp. This issue will be fixed (eventually) when Fastcomp is migrated to use a LLVM 3.4 or later.

How to use g2o framework for Graph Optimization (SLAM) on windows?

I'm working on a graph slam project and i want to use g2o framework (https://github.com/RainerKuemmerle/g2o) de develop the application using visual studio 2010. This framework works primarly on linux but it can be used for windows as well.
Could any one tell me how to use with visual studio
Thank you,
Regards
You can use it in Windows because all requirements have a port to Visual Studio.
cmake http://www.cmake.org/
Eigen3 http://eigen.tuxfamily.org
suitesparse http://www.cise.ufl.edu/research/sparse/SuiteSparse/
Qt4 http://qt.nokia.com/
libQGLViewer http://www.libqglviewer.com/
Our primary development platform is Linux. Experimental support for
Mac OS X and Windows (MinGW or MSVC). We recommend a so-called out of
source build which can be achieved by the following command sequence.(1)
Use cmake to build it.
I remember having some issues with building g2o on Windows. But the CMake should work well. Just configure, generate, and you can open the solution with Visual Studio and build. If it says "Configuring Done", it should compile. Eigen3 is sometimes tough to find for CMake, as their find script is not officially distributed with CMake (yet).
You can run (assuming you are in g2o/trunk/build folder, hence ..):
cmake .. -DCMAKE_MODULE_PATH=/path/to/a/dir/containing_the_FindEigen3.cmake_file/
There are also other libraries that solve graph problems efficiently, such as SLAM++, iSAM or GTSAM, they compile on Windows with less problems.

Using MSBuild for C++ with VS2005

Is it possible to use the latest MSBuild (.NET4/VS2010) with the VS2005 toolchain?
I have a C++ project which compiles against VS2005. I'm not ready to upgrade to VS2010 while the compiler is still in beta. But I'd like to use the new version of MSBuild because it builds C++ natively and provides extension points and flexibility which the old VCBuild tool doesn't.
Does anyone know if you can use MSBuild this way? Or is MSBuild in .NET 4 coupled to the VS2010 toolchain?
Thanks in advance,
Ben
If you are not ready to upgrade to VS2010 because it is in Beta, are you not concerned that .NET 4.0 is beta? You can use MSBuild 4.0 to target other version of the .NET runtime (2.0 and above), but those tools are in beta as well.
You would have to convert your projects files to MSBuild 4.0 project files and then use those. The easiest way to do this is to open the solution file in Visual Studio 2010.
Sayed Ibrahim Hashimi
My Book: Inside the Microsoft Build Engine : Using MSBuild and Team Foundation Build
This answer is probably no longer interesting to you but in case anyone hits this on a search:
MSBuild as available with .net 4.0 can be used to build native c++ projects that target VS2010, VS2008 or (with a bit of customisation) VS2005
This is done by setting the Platform Toolset.
See the following blog post for a detailed description:
http://blogs.msdn.com/b/vcblog/archive/2009/12/08/c-native-multi-targeting.aspx