cross compiling with mingw on linux to windows fails
Created by: vrecan
I am currently cross compiling zmq and sodium without issue. I wanted to start using goczmq and to do that I need to pull in czmq. Here is my script so far for compiling:
PREFIX=x86_64-w64-mingw32
CFLAGS="-DLIBCZMQ_EXPORTS -D__USE_MINGW_ANSI_STDIO"
cd $name-$version; make clean;./autogen;mingw64-configure configure --host=$PREFIX; mingw64-make; make install DESTDIR=$installDir
This is the error I am getting.
make[1]: Entering directory `/home/vrecan/NGLM_Thirdparty/czmq/czmq-3.0.2'
CC src/src_libczmq_la-zactor.lo
In file included from src/../include/czmq_library.h:24:0,
from src/../include/czmq.h:30,
from src/zactor.c:34:
src/../include/czmq_prelude.h:450:20: error: conflicting types for 'int8_t'
typedef __int8 int8_t;
^
In file included from /usr/lib/gcc/x86_64-w64-mingw32/4.9.1/include/stdint.h:9:0,
from /usr/x86_64-w64-mingw32/sys-root/mingw/include/zmq.h:87,
from src/../include/czmq_prelude.h:209,
from src/../include/czmq_library.h:24,
from src/../include/czmq.h:30,
from src/zactor.c:34:
/usr/x86_64-w64-mingw32/sys-root/mingw/include/stdint.h:35:21: note: previous declaration of 'int8_t' was here
typedef signed char int8_t;
^
src/zactor.c:100:1: error: 'zactor_new' redeclared without dllimport attribute: previous dllimport ignored [-Werror=attributes]
zactor_new (zactor_fn *actor, void *args)
^
src/zactor.c:156:1: error: 'zactor_destroy' redeclared without dllimport attribute after being referenced with dll linkage [-Werror]
zactor_destroy (zactor_t **self_p)
^
src/zactor.c:183:1: error: 'zactor_send' redeclared without dllimport attribute: previous dllimport ignored [-Werror=attributes]
zactor_send (zactor_t *self, zmsg_t **msg_p)
^
src/zactor.c:195:1: error: 'zactor_recv' redeclared without dllimport attribute: previous dllimport ignored [-Werror=attributes]
zactor_recv (zactor_t *self)
^
src/zactor.c:205:1: error: 'zactor_is' redeclared without dllimport attribute after being referenced with dll linkage [-Werror]
zactor_is (void *self)
^
src/zactor.c:218:1: error: 'zactor_resolve' redeclared without dllimport attribute: previous dllimport ignored [-Werror=attributes]
zactor_resolve (void *self)
^
src/zactor.c:233:1: error: 'zactor_sock' redeclared without dllimport attribute: previous dllimport ignored [-Werror=attributes]
zactor_sock (zactor_t *self)
^
src/zactor.c:280:1: error: 'zactor_test' redeclared without dllimport attribute: previous dllimport ignored [-Werror=attributes]
zactor_test (bool verbose)
^
cc1: all warnings being treated as errors
The zeromq and sodium builds don't require the cflags or the --host but I was reading other issues and people mentioned that they fixed mingw builds for them.
Any help would be greatly appreciated!