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

Windows support via MSYS mingw-w64-ucrt-x86_64 #206

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alex-Symbroson
Copy link

This merge request relates to #142, #123 and, fundamentally, #23

It fixes compilation issues on Windows, specifically MSYS builds with the mingw-w64-ucrt-x86_64-gcc compiler and the related toolchain.

The changes can be broken down to the following:

  • casting -1 error states for NativeSocketType
  • linking against ws2_32.dll
  • allowing unsafe function pointer casts in wepoll.c

Requirements:

  • Install MSys
  • Install toolchain
packman -Syuu
pacman -S  mingw-w64-ucrt-x86_64-gcc  mingw-w64-ucrt-x86_64-cmake  mingw-w64-ucrt-x86_64-make
# optional
pacman -S  mingw-w64-ucrt-x86_64-openssl

Build instructions:

mkdir build
cd build
cmake -G "MinGW Makefiles"
mingw32-make.exe

Test output:

seasocks\build> .\src\test\c\AllTests.exe       
===============================================================================
All tests passed (66040 assertions in 83 test cases)

Toolchain:

C:\msys64\ucrt64\bin\cmake.exe --version
cmake version 3.31.4
CMake suite maintained and supported by Kitware (kitware.com/cmake).

C:\msys64\ucrt64\bin\g++.exe --version  
g++.exe (Rev2, Built by MSYS2 project) 14.2.0
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

C:\msys64\ucrt64\bin\mingw32-make.exe --version        
GNU Make 4.4.1
Built for Windows32
Copyright (C) 1988-2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

@alex-Symbroson alex-Symbroson changed the title MSYS mingw-w64-ucrt-x86_64 support Windows support via MSYS mingw-w64-ucrt-x86_64 Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant