Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Cross-Build for Windows #24

Open
Seji64 opened this issue Nov 17, 2017 · 4 comments
Open

How to Cross-Build for Windows #24

Seji64 opened this issue Nov 17, 2017 · 4 comments
Labels

Comments

@Seji64
Copy link

Seji64 commented Nov 17, 2017

Hello,

can someone give me some tips on how to compile a Windows binary on Linux?

I am using Debian 9 and have tried the following:

  • autoreconf --install
  • /configure --build=turingmachine-unknown-linux-gnu --host=mingw32
  • make

Then I get the following error:

make  all-am
make[1]: Verzeichnis „/opt/iodine“ wird betreten
x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I.  -DWINDOWS32  -pedantic -O3 -fno-strict-aliasing  -MT src/iodine-common.o -MD -MP -MF src/.deps/iodine-common.Tpo -c -o src/iodine-common.o `test -f 'src/common.c' || echo './'`src/common.c
In file included from src/common.c:19:0:
./config.h:234:19: error: two or more data types in declaration specifiers
 #define socklen_t int
                   ^
In file included from src/common.c:58:0:
src/common.h:64:0: warning: "BITS_64" redefined
 #define BITS_64 1

src/common.h:56:0: note: this is the location of the previous definition
 #define BITS_64

src/common.c: In function ‘socket_set_blocking’:
src/common.c:415:31: warning: passing argument 3 of ‘ioctlsocket’ from incompatible pointer type [-Wincompatible-pointer-types]
  if (ioctlsocket(fd, FIONBIO, &blocking) != 0) {
                               ^
In file included from src/common.c:37:0:
/usr/share/mingw-w64/include/winsock2.h:977:34: note: expected ‘u_long * {aka long unsigned int *}’ but argument is of type ‘int *’
   WINSOCK_API_LINKAGE int WSAAPI ioctlsocket(SOCKET s,__LONG32 cmd,u_long *argp);
                                  ^~~~~~~~~~~
src/common.c: In function ‘check_tcp_error’:
src/common.c:469:43: warning: passing argument 4 of ‘getsockopt’ from incompatible pointer type [-Wincompatible-pointer-types]
  if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &errornum, &len) != 0) {
                                           ^
In file included from src/common.c:37:0:
/usr/share/mingw-w64/include/winsock2.h:980:34: note: expected ‘char *’ but argument is of type ‘int *’
   WINSOCK_API_LINKAGE int WSAAPI getsockopt(SOCKET s,int level,int optname,char *optval,int *optlen);
                                  ^~~~~~~~~~
Makefile:969: die Regel für Ziel „src/iodine-common.o“ scheiterte
make[1]: *** [src/iodine-common.o] Fehler 1
make[1]: Verzeichnis „/opt/iodine“ wird verlassen
Makefile:628: die Regel für Ziel „all“ scheiterte
make: *** [all] Fehler 2

It's my first time trying to cross-build so i don't have really a glue....

Thanks in advance

@frekky
Copy link
Owner

frekky commented Jan 1, 2018

Hi and happy 2018! Currently support is unavailable for Windows which may change in the coming months depending on time and availability of Windows systems to experiment with.
Perhaps the most straightforward solution is to run iodine inside a Linux VM (using for example Virtualbox). Good luck!

@frekky frekky added the wontfix label Jan 1, 2018
@Lanchon
Copy link

Lanchon commented Jan 2, 2018 via email

@twumasiandrews
Copy link

Comment out #define socklen_t int in config.h
and add "-liphlpapi -lws2_32" to LIBS in makefile. Typecast the variables in the warning to respective types in common.h(not necessary, clears the warnings). At least the iodine client compiles without errors by doing the above.

@Anime4000
Copy link

@Seji64 I did compile this version of iodine...
you can see log here: https://gist.github.com/Anime4000/03bb3d18b0cfdfa9e2439e3dc045d0c2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants