ssh-connect
ssh-connect copied to clipboard
why build error
Run x86_64-w64-mingw3[2](https://github.com/aogg/ssh-connect/actions/runs/6523249170/job/17713689213#step:4:2)-gcc -o connect.exe connect.c -lws2_32 -lwsock32 -liphlpapi
x86_64-w64-mingw32-gcc -o connect.exe connect.c
shell: /usr/bin/bash -e {0}
connect.c: In function ‘accept_connection’:
connect.c:28[3](https://github.com/aogg/ssh-connect/actions/runs/6523249170/job/17713689213#step:4:3)[5](https://github.com/aogg/ssh-connect/actions/runs/6523249170/job/17713689213#step:4:6):5: error: unknown type name ‘SOCKLEN_T’; did you mean ‘SOCKET’?
2[8](https://github.com/aogg/ssh-connect/actions/runs/6523249170/job/17713689213#step:4:9)35 | SOCKLEN_T socklen;
| ^~~~~~~~~
| SOCKET
Error: Process completed with exit code 1.
name: Build win
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up MinGW
run: sudo apt-get install -y mingw-w64
- name: Compile win
run: x86_64-w64-mingw32-gcc -o connect.exe connect.c -lws2_32 -lwsock32 -liphlpapi
- name: ls -al
run: ls -al ./
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v1.1.${{ github.run_number }}
release_name: Release v1.1.${{ github.run_number }}
body: Release of win latest
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./connect.exe
asset_name: connect.exe
asset_content_type: application/octet-stream
For Windows the suggestion is to include #include <ws2tcpip.h>, see https://stackoverflow.com/a/60045740/1632368
I did not try it though.
For Fedora 40, I had a similar error message. The solution was to replace SOCKLEN_T with socklen_t