3

I have been following the steps in Peter's answer to How to build Google's protobuf in Windows using MinGW? but make does not complete and errors out.


I am on Win64 and have MinGW with installed the mingw-developer-toolkit, mingw32-base, mingw-gcc-g++, msys-base and additionally mingw32-phtreads-w32.

Under MinGW/msys/1.0 I create the folder /home/<username> and paste the protobuf-3.1.0 source downloaded from github.

I open an MSYS shell, cd into the protobuf dir and run ./autoconfig: the log is here.

Now, the first thing I don't like from the log is:

configure:16556: checking for the pthreads library -lpthreads
configure:16589: gcc -o conftest.exe     conftest.c -lpthreads -lz  >&5
c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../../mingw32/bin/ld.exe: cannot find -lpthreads

Why is it not finding pthreads when I have it installed?

Then, I proceed with make and get protoc.exe has stopped working with the following crash info:

  Problem signature:
  Problem Event Name:   APPCRASH
  Application Name: protoc.exe
  Application Version:  0.0.0.0
  Application Timestamp:    580a23df
  Fault Module Name:    libprotobuf-11.dll
  Fault Module Version: 0.0.0.0
  Fault Module Timestamp:   580a225f
  Exception Code:   c0000005
  Exception Offset: 001171cd
  OS Version:   6.1.7601.2.1.0.256.4
  Locale ID:    2057
  Additional Information 1: 4c0d
  Additional Information 2: 4c0d4d78887f76d971d5d00f1f20a433
  Additional Information 3: 4c0d
  Additional Information 4: 4c0d4d78887f76d971d5d00f1f20a433

and the shell ends with

make[2]: *** [unittest_proto_middleman] Error 5
make[2]: Leaving directory `/home/ok1011/protobuf-3.1.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/ok1011/protobuf-3.1.0'
make: *** [all] Error 2

Here you can find the make log and error. I am not the only one having this issue.

Any ideas what might be the problem and how to fix it?

Community
  • 1
  • 1
Oleg
  • 10,406
  • 3
  • 29
  • 57
  • 2
    You need the 64 bit version of MinGW which comes with the pthreads library be default. Or you need one of the older pthread ports for MinGW in case you must have the 32 bit version. – πάντα ῥεῖ Oct 21 '16 at 15:01
  • your environment is not proper I think...install appropriate `MSYS with mingw` – MD. Nazmul Kibria Oct 26 '16 at 04:50
  • Can you compile it without tests? – Shmuel H. Oct 28 '16 at 07:09
  • I small update: I managed to install it with MinGW64, using cmake instructions rather than *nix style `make` but MinGW 64 fails to install on my other pc. So I was trying the MSYS2 setup on the other pc...but it's a pain setting up all the dependencies. So, I abandoned my effort with Windows and I am using a virtual machine with linux. So far, things work. – Oleg Oct 28 '16 at 12:09

0 Answers0