Building Google Protocol Buffers on Windows using MinGW

Building Google Protocol Buffers on Windows using MinGW


This post shows how to build Google Protocol buffers on Windows using MinGW.

1.) Make sure you install mingw:

http://www.mingw.org/

http://sourceforge.net/projects/mingw/files/MinGW/

2.) Download protocol buffer source:

http://code.google.com/p/protobuf/downloads/list

4.) Unzip and Copy the Protobuf source to the MinGW\msys directory:

C:\MinGW\msys\1.0\home\user\protobuf-2.4.1

5.) Open a MINGW32 shell from your start menu (installed with mingw) and change directories to the protobuf folder. Note that to build static libraries you can pass '--enable-static' and'--disable-shared' to the configure step in order to produce '.a' static libraries instead of '.dll' dynamic linked libraries.

cd protobuf-2.4.1

./configure --prefix=`pwd`

make

make install

The libraries ( libprotobuf-7.dll , etc. ) are installed in:

C:\MinGW\msys\1.0\home\user\protobuf-2.4.1\bin

Now copy these libraries to the appropriate location on your disk to link with or otherwise use!



ClassyBits 2016