installing thrift idl - c++

Basically I have no idea how to create the lib files. The VS solution that come with thrift(0.9.0) say they are created with a newer version and therefore cant' be open with VS 2008. I've also tried installing or running the ./bootstrap.sh but I keep getting an error saying that the file is not an executable.I've been screwing with this for hours and can't figure it out so if someone who knows how to install thrift please guide me.

I haven't been using thrift on windows, but I hope it doesn't matter. First you have to install thrift locally (0.8.0, 0.9.0, whatever). On linux you run ./configure, make, make install. Once you've got your thrift locally installed, you do have the thrift binary and you should make sure it is on the shell path (on linux it's /usr/local/bin/thrift). Then create a thrift definition file with a service, run the thrift binary against that file and thrift will generate code for you (I assume you'll generate C++ code).
Now - for each programming language thrift generates different files, of course. In scripting languages you have to include them manually. In Java you will have a package and you can use it in the rest of the code. And in C++ you'll get .h and .cpp files which you should compile into a library. I strongly encourage you to use cmake, which is a wonderful tool to perform such things automatically.
Anyway, I wouldn't expect that MS Visual Studio will happily cooperate with open source software such as Apache Software Foundation projects ;)

You need use VS2012 and boost_155 like minimum to create the thrift lib files.

Related

How to install ZeroMQ for C++ using VS2015 community

I am trying to learn networking in windows in C++ (specifically for making a very simple mmo server).
I was reading about cross-platform-ness and socket complexity and came accross both protobuf and zeroMQ quite a lot.
After reading about zeroMQ I decided it makes sense for an mmo server.
So i went over to the zeroMQ website and downloaded the msi installer. I ran it, and now i'm stuck.
I don't quite understand what the MSI did... Did it plop a zeroMQ.dll in system32? Di I still need to get the C++ binding? Basically, how do you install zeromq for C++?
P.S. extra points if someone shows me how to do it with Nuget. I guess that's why I don't know how to install libraries manually, I always use Nuget...
Thanks.
Nuget does have a package for ZeroMQ, but that seems to be only for C# currently.
The MSI you installed contains Python binding for ZeroMQ, and is installed for the selected python version in the installer.
For C++, they have pre-build binaries on their download page.
However, these libraries are build with an older version of Visual Studio, which are not compatible with Visual Studio 2015. If you want to use ZeroMQ, i'm afraid you are going to have to build the library your self.
When you have successfully build ZeroMQ, you can follow their guide to get a feeling of how to use it. Or you can add the C++ bindings which has a pretty and easy-to-use interface.

Running Python from C++ (VS2010, compiler v100)

I have some code here that we used to use to call a Python script from our (very large) application. It worked fine when we used VS2008 (compiler v90), which is what the default version of python27 was compiled with.
In the last year we've upgraded our application to VS2010, and I was looking to update the Python-calling dll, thinking it would be a morning's work. Unfortunately, after wrestling with the linker and missing dlls for ages, most of my colleagues agree that our application and python27.dll are using incompatible versions of Windows CRT.
I thought it would be simple enough to find a version of python27.dll (or indeed another version would be fine) compiled with VS2010 (v100) - but I can't.
Is there a way to call a Python script from an application compiled in VS2010?
An answer may be: Download the python sources - compile a custom python.dll and link against that.
I have the same problem. The solution is indeed to build python from the sources. But there is a big drawback: all extra 3rd party python modules pre-build for Windows that you download from internet will not work! This is because all of those modules will be prebuild with VS 2008 and you get again in trouble with incompatible runtimes. The solution is that all such extra modules needs to be again rebuild from sources, but the task is not easy in all cases. The modules are ususally tested in VS2008 and you get a lot of troubles trying to run them with VS2010. I got this mostly with database connectors for MySQL, MSSQL and others.

How to use C++ (in Linux) to connect MYSQL database (in WINDOWS)

I built a database of MYSQL in windows environment, I found a lot examples C++ API for MYSQL in visual studio environment. But I am not sure that if I write a program to test the C++ API by using gcc or other tools in LINUX environment (just compile and run the program, without the platform like eclipse). Because in visual studio, I need to add some lib and dll for MYSQL. Shall I need to write a configuration file? How can I do this, thanks a lot!
I want to make it more clear. The database is built in WINDOWS, I want to run my c++program in Linux. So how to compile them with some lib required by MYSQL. And is there something different when I am not in visual studio?
MySQL ships with C++ bindings, available in cppconn/* and mysql_connection.h in your include path. You will need Boost (at least shared_ptr and variant).
Check out the documentation for examples and the reference.

how to compile c++ files with cygwin on windows 7

I have installed cygwin. But when I try to compile a c++ file it gives the following error:
/usr/lib/gcc/i686-pc-cygwin/4.3.4/cc1plus.exe: error while loading shared libraries: cygmpfr-1.dll: cannot open shared object file: No such file or directory
I checked in the lib folder there is no library with the name cygmpfr-1.dll. So is it that I have to put that dll in the lib folder. I have tried to search for the dll but could not find this dll so that i can download. I am just a beginner in C++. I have tried to setup cygwin support in netbeans as well, but there also if I try to run the sample files given, it throws the above error.
Can anybody give me a clue?
You need to install the gcc4-g++ package via http://cygwin.com/setup.exe
You only have gcc4 installed.
This will also install your missing dependencies.
If you're a beginner in C/C++, and you're running Windows, then why not take the simple route and get Visual-C++ Express, a free IDE from Microsoft for Windows.
It provides a GUI IDE (Integrated Development Environment), but if you prefer a text editor and command-line tools (compilers, debuggers, etc) those are available to you also, if you install Visual-C++ Express.
There are also tutorials and lessons to get you started.
On the other hand, if you really wanna focus on C++ on Linux, then you should probably uninstall Windows 7 right now.
I have had similar problems and I am no beginner. Try using the cygwin installer, and searching it for all versions of gmp. There generally are 32bit and 64 bit versions. Check everything you see and update your installation. Hope this helps. Some of these dll's you can find on the internet, but not the one you are looking for.

How to install MinGW correctly on Windows

I have recently started learning C++, but I require a compiler. I have tried the one packaged with Code::Blocks, but I have been told it is out of date.
I have tried reading the instructions on the website, but I simply don't know which files to download and un-zip. Is there a list of files to download? (latest version) and a folder structure I need?
I was the person that pointed you at the more up-to-date version at Twilight Dragon. The file you want there is http://sourceforge.net/projects/tdm-gcc/files/TDM-MinGW%20Installer/1.908.0/tdm-mingw-1.908.0-4.4.1-2.exe/download which is a Windows binary installer - you just run it. Note that you don't actually need to do this - the version that comes with Code::Blocks will work OK for someone starting to learn C++.
I recommend using a pre-packaged MinGW that includes some common APIs like Boost, SDL etc: http://nuwen.net/mingw.html
If I remember correctly, the only thing you must do to get it working is to modify Windows's PATH environment variable.
edit: OpenAL is not included in this package.
Here are some instructions to have a MinGW setup that I used to build Octave modules.
I have switched to using the build environment for msysgit. Just download the netinstall file and it will setup GCC, Make, etc. along with Git.