digideskio / protobuf-c

Automatically exported from code.google.com/p/protobuf-c
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

compiling protobuf-c with mingw #17

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Install mingw compiler from ubuntu repository, build and install 
protobuf.
2. Now, I'm trying to configure protobuf-c
./configure --prefix=/usr/i586-mingw32msvc --host=i586-mingw32msvc
3. then build protobuf-c (see notes about LDFLAGS below)
make LDFLAGS=-no-undefined

What is the expected output? What do you see instead?
Instead of successful build process, compiler reports errors about header 
files alloca.h and sys/poll.h. There are no such files in mingw include 
directory. alloca.h solved with ln -s malloc.h alloca.h, but it seems 
sys/poll.h haven't equivalent in mingw.

What version of the product are you using? On what operating system?
I'd tried with 0.9 and 0.10 version of protobuf-c. I've used Ubuntu 8.10 
and mingw installation from it's official repository.

Please provide any additional information below.
protobuf and protobuf-c also has troubles with building shared libraries 
with mingw, it's solved with LDFLAGS according to http://www.mail-
archive.com/libtool@gnu.org/msg09482.html

Original issue reported on code.google.com by reddot.r...@gmail.com on 9 Apr 2009 at 3:00

GoogleCodeExporter commented 8 years ago
Trying to build 0.15 version in recent mingw (4.6.2 gcc)

and have this :

sh.exe"-3.1$ make LDFLAGS=-no-undefined
Making all in src
make[1]: Entering directory `C:/progs/mingw/src/protobuf-c-0.15/src'
make[2]: Entering directory `C:/progs/mingw/src/protobuf-c-0.15/src'
C:/progs/mingw/bin/sh.exe ../libtool --tag=CC   --mode=compile gcc 
-DPACKAGE_NAME=\"protobuf-c\" -DPACKAGE_TARNAME=\"protobuf-c\" 
-DPACKAGE_VERSION=\"0.15\" -DPACKAGE_STRING=\"protobuf-c\ 0.15\" -DPACKAGE_
BUGREPORT=\"\" -DPACKAGE=\"protobuf-c\" -DVERSION=\"0.15\" -DSTDC_HEADERS=1 
-DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 
-DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES
_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=\".libs/\" 
-DHAVE_INTTYPES_H=1 -DHAVE_MALLOC_H=1 -DHAVE_WINSOCK_H=1 -DHAVE_IO_H=1 
-DHAVE_UNISTD_H=1 -DIS_LITTLE_ENDIAN=1 -I.     -g -O2 -MT protobuf-c-d
ispatch.lo -MD -MP -MF .deps/protobuf-c-dispatch.Tpo -c -o 
protobuf-c-dispatch.lo `test -f 'google/protobuf-c/protobuf-c-dispatch.c' || 
echo './'`google/protobuf-c/protobuf-c-dispatch.c
libtool: compile:  gcc "-DPACKAGE_NAME=\\protobuf-c\\ 
-DPACKAGE_TARNAME=\\protobuf-c\\ -DPACKAGE_VERSION=\\0.15\\ 
-DPACKAGE_STRING=\\protobuf-c 0.15\\ -DPACKAGE_BUGREPORT=\\\\\\" 
"-DPACKAGE=\\protobuf-c\\
-DVERSION=\\0.15\\ -DSTDC_HEADERS=1" -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 
-DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 
-DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=
1 "-DLT_OBJDIR=\\.libs/\\ -DHAVE_INTTYPES_H=1" -DHAVE_MALLOC_H=1 
-DHAVE_WINSOCK_H=1 -DHAVE_IO_H=1 -DHAVE_UNISTD_H=1 -DIS_LITTLE_ENDIAN=1 -I. -g 
-O2 -MT protobuf-c-dispatch.lo -MD -MP -MF .deps/protobuf-c-d
ispatch.Tpo -c google/protobuf-c/protobuf-c-dispatch.c -o protobuf-c-dispatch.o
google/protobuf-c/protobuf-c-dispatch.c: In function 'protobuf_c_dispatch_new':
google/protobuf-c/protobuf-c-dispatch.c:200:11: error: 'SIGPIPE' undeclared 
(first use in this function)
google/protobuf-c/protobuf-c-dispatch.c:200:11: note: each undeclared 
identifier is reported only once for each function it appears in
google/protobuf-c/protobuf-c-dispatch.c: In function 
'protobuf_c_dispatch_dispatch':
google/protobuf-c/protobuf-c-dispatch.c:532:20: error: 'RealDispatch' has no 
member named 'fd_map'
google/protobuf-c/protobuf-c-dispatch.c:556:6: error: 'RealDispatch' has no 
member named 'fd_map'
google/protobuf-c/protobuf-c-dispatch.c: In function 'events_to_pollfd_events':
google/protobuf-c/protobuf-c-dispatch.c:626:47: error: 'POLLIN' undeclared 
(first use in this function)
google/protobuf-c/protobuf-c-dispatch.c:627:47: error: 'POLLOUT' undeclared 
(first use in this function)
google/protobuf-c/protobuf-c-dispatch.c: In function 'pollfd_events_to_events':
google/protobuf-c/protobuf-c-dispatch.c:633:18: error: 'POLLIN' undeclared 
(first use in this function)
google/protobuf-c/protobuf-c-dispatch.c:634:18: error: 'POLLOUT' undeclared 
(first use in this function)
google/protobuf-c/protobuf-c-dispatch.c: In function 'protobuf_c_dispatch_run':
google/protobuf-c/protobuf-c-dispatch.c:650:11: error: invalid application of 
'sizeof' to incomplete type 'struct pollfd'
google/protobuf-c/protobuf-c-dispatch.c:652:21: error: invalid application of 
'sizeof' to incomplete type 'struct pollfd'
google/protobuf-c/protobuf-c-dispatch.c:655:7: error: invalid use of undefined 
type 'struct pollfd'
google/protobuf-c/protobuf-c-dispatch.c:655:10: error: dereferencing pointer to 
incomplete type
google/protobuf-c/protobuf-c-dispatch.c:656:7: error: invalid use of undefined 
type 'struct pollfd'
google/protobuf-c/protobuf-c-dispatch.c:656:10: error: dereferencing pointer to 
incomplete type
google/protobuf-c/protobuf-c-dispatch.c:657:7: error: invalid use of undefined 
type 'struct pollfd'
google/protobuf-c/protobuf-c-dispatch.c:657:10: error: dereferencing pointer to 
incomplete type
google/protobuf-c/protobuf-c-dispatch.c:702:5: error: invalid use of undefined 
type 'struct pollfd'
google/protobuf-c/protobuf-c-dispatch.c:702:12: error: dereferencing pointer to 
incomplete type
google/protobuf-c/protobuf-c-dispatch.c:710:5: error: invalid use of undefined 
type 'struct pollfd'
google/protobuf-c/protobuf-c-dispatch.c:710:12: error: dereferencing pointer to 
incomplete type
google/protobuf-c/protobuf-c-dispatch.c:712:9: error: invalid use of undefined 
type 'struct pollfd'
google/protobuf-c/protobuf-c-dispatch.c:712:34: error: dereferencing pointer to 
incomplete type
google/protobuf-c/protobuf-c-dispatch.c:713:9: error: invalid use of undefined 
type 'struct pollfd'
google/protobuf-c/protobuf-c-dispatch.c:713:63: error: dereferencing pointer to 
incomplete type
make[2]: *** [protobuf-c-dispatch.lo] Error 1
make[2]: Leaving directory `C:/progs/mingw/src/protobuf-c-0.15/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `C:/progs/mingw/src/protobuf-c-0.15/src'
make: *** [all-recursive] Error 1

Original comment by masa...@gmail.com on 20 Apr 2012 at 8:49

GoogleCodeExporter commented 8 years ago
confirm the issue, is it needed for structs encoding/decoding? Not interested 
in services/RPC

Original comment by teomu...@gmail.com on 31 Jul 2012 at 9:36

GoogleCodeExporter commented 8 years ago
Confirm the issue, but you still can build protoc-c compliler with "make 
protoc-c.exe"

Original comment by dolinenko@gmail.com on 18 Jan 2013 at 10:35

GoogleCodeExporter commented 8 years ago
Iam trying to compile this on a redhat linux with gcc, and facing the same 
issue.
Do we have a workaround?

Original comment by ssk...@gmail.com on 13 Sep 2013 at 1:52

GoogleCodeExporter commented 8 years ago
I have managed to build it for mingw with a patches attached and configure 
switches:

--enable-shared --disable-static --disable-protoc --disable-services 
--with-endianness=little

This makes win32 API a bit different from linux one (it doesn't contain 
protobuf-c-dispatch.h and protobuf-c-rpc.h parts), but I don't think it's a 
real problem.

Original comment by tom...@wasilczyk.pl on 27 Sep 2013 at 12:30

Attachments:

GoogleCodeExporter commented 8 years ago
Hi,

In what order patch & .sh should be used?
For wich version of protobuf-c are done?

I use the autogen.sh first then when I apply the patch I have :

$ patch < protobuf-c-disable-services.patch 
patching file configure.ac
patching file Makefile.am
Hunk #1 FAILED at 26.
Hunk #2 FAILED at 60.
2 out of 2 hunks FAILED -- saving rejects to file Makefile.am.rej

I use protobuf-c-0.15.

Original comment by be.blind...@gmail.com on 13 Feb 2014 at 10:42

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Compiled using 332 svn rev and Cmake 2.8.12.2
without additional switches \ turned off options

Original comment by masa...@gmail.com on 13 Feb 2014 at 7:41