Skip to content
This repository was archived by the owner on Aug 22, 2021. It is now read-only.

This fixes build of the project on Windows#101

Merged
ambrop72 merged 1 commit intoambrop72:masterfrom
abryantsev:windows_build_fix
Jun 6, 2020
Merged

This fixes build of the project on Windows#101
ambrop72 merged 1 commit intoambrop72:masterfrom
abryantsev:windows_build_fix

Conversation

@abryantsev
Copy link
Contributor

I tried to build the master branch of the project with -DBUILD_NOTHING_BY_DEFAULT=1 -DBUILD_TUN2SOCKS=1 -DBUILD_UDPGW=1 on Windows. It failed with multiple exceptions:

...
Build FAILED.

"C:\Programming\projects\badvpn\build\install.vcxproj" (default target) (1) ->
"C:\Programming\projects\badvpn\build\ALL_BUILD.vcxproj" (default target) (3) ->
"C:\Programming\projects\badvpn\build\tun2socks\badvpn-tun2socks.vcxproj" (default target) (4) ->
"C:\Programming\projects\badvpn\build\flowextra\flowextra.vcxproj" (default target) (7) ->
"C:\Programming\projects\badvpn\build\system\system.vcxproj" (default target) (8) ->
(ClCompile target) ->
  c:\programming\projects\badvpn\system\bconnection_win.c(801): warning C4133: 'function': incompatible types - from 's
ocklen_t *' to 'sockaddr *' [C:\Programming\projects\badvpn\build\system\system.vcxproj]
  c:\programming\projects\badvpn\system\bconnection_win.c(808): warning C4024: 'addr_sys_to_socket': different types fo
r formal and actual parameter 2 [C:\Programming\projects\badvpn\build\system\system.vcxproj]


"C:\Programming\projects\badvpn\build\install.vcxproj" (default target) (1) ->
"C:\Programming\projects\badvpn\build\ALL_BUILD.vcxproj" (default target) (3) ->
"C:\Programming\projects\badvpn\build\tun2socks\badvpn-tun2socks.vcxproj" (default target) (4) ->
"C:\Programming\projects\badvpn\build\flowextra\flowextra.vcxproj" (default target) (7) ->
"C:\Programming\projects\badvpn\build\system\system.vcxproj" (default target) (8) ->
(ClCompile target) ->
  c:\programming\projects\badvpn\system\bconnection_win.c(799): error C2079: 'sysaddr' uses undefined struct 'BDatagram
_sys_addr' [C:\Programming\projects\badvpn\build\system\system.vcxproj]
  c:\programming\projects\badvpn\system\bconnection_win.c(800): error C2224: left of '.addr' must have struct/union typ
e [C:\Programming\projects\badvpn\build\system\system.vcxproj]
  c:\programming\projects\badvpn\system\bconnection_win.c(801): error C2224: left of '.addr' must have struct/union typ
e [C:\Programming\projects\badvpn\build\system\system.vcxproj]
  c:\programming\projects\badvpn\system\bconnection_win.c(801): error C2198: 'getsockname': too few arguments for call
[C:\Programming\projects\badvpn\build\system\system.vcxproj]
  c:\programming\projects\badvpn\system\bconnection_win.c(805): error C2224: left of '.len' must have struct/union type
 [C:\Programming\projects\badvpn\build\system\system.vcxproj]
  c:\programming\projects\badvpn\system\bconnection_win.c(808): error C2440: 'function': cannot convert from 'int' to '
sys_addr' [C:\Programming\projects\badvpn\build\system\system.vcxproj]
  c:\programming\projects\badvpn\system\bconnection_win.c(812): error C2059: syntax error: 'type' [C:\Programming\proje
cts\badvpn\build\system\system.vcxproj]
  c:\programming\projects\badvpn\system\bdatagram_win.c(655): error C2059: syntax error: 'type' [C:\Programming\project
s\badvpn\build\system\system.vcxproj]

    2 Warning(s)
    8 Error(s)

I Identified the problem was brought by few commits: e837e8d and 6241fc2:

  • in the BConnection_win.c sys_addr type is used defined in the same class instead of the BDatagram_sys_addr defined in the BDatagram_win.h. Latter even not included.
  • there is an attempt to pass int() parameter as an argument to BLog function. The syntax is incorrect.

@4-FLOSS-Free-Libre-Open-Source-Software

@ambrop72 ambrop72 merged commit 4b7070d into ambrop72:master Jun 6, 2020
@ambrop72
Copy link
Owner

ambrop72 commented Jun 6, 2020

Thanks.

@abryantsev
Copy link
Contributor Author

No problem, thank you for merging.

@abryantsev abryantsev deleted the windows_build_fix branch June 7, 2020 00:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants