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

[BUG] "winsock2.h" not found error on mingw64 #280

Open
1 task done
computergeek1507 opened this issue Sep 2, 2022 · 3 comments
Open
1 task done

[BUG] "winsock2.h" not found error on mingw64 #280

computergeek1507 opened this issue Sep 2, 2022 · 3 comments
Assignees
Labels
bug Confirmed bugs or reports that are very likely to be bugs.

Comments

@computergeek1507
Copy link

Prerequisites

Description

I am attempting to compile libhttpserver on Windows 10 using msys2 with mingw64.

Steps to Reproduce

  1. pacman -S mingw-w64-x86_64-libmicrohttpd
  2. git clone https://github.com/etr/libhttpserver.git
  3. cd libhttpserver
  4. mkdir build
  5. cd build
  6. ../configure
  7. or ../configure --disable-fastopen --prefix /mingw64 CXXFLAGS=-I/mingw64/include LDFLAGS=-L/mingw64/lib

Expected behavior: [What you expect to happen]

Actual behavior: [What actually happens]
If I run "../configure" by itself I get an configuration error for "winsock2.h" not found

also tried

"../configure --disable-fastopen --prefix /mingw64 CXXFLAGS=-I/mingw64/include LDFLAGS=-L/mingw64/lib"
"../configure --disable-fastopen --prefix=/D/msys64/mingw64 CXXFLAGS=-I/D/msys64/mingw64/include LDFLAGS=-L/D/msys64/mingw64/lib"

I get an configuration error for "error.h" not found

Reproduces how often: 100%

Versions

  • OS version Windows 10 Pro 21H2
  • libhttpserver version: github master
  • libmicrohttpd version : mingw-w64-x86_64-libmicrohttpd 0.9.75-2

If you have problems during build:

  • Compiler version
  • autotools version

Additional Information

Any additional information, configuration (especially build configuration flags if you compiled the libraries) or data that might be necessary to reproduce the issue.

If you have problems during build, please attach your config.log and the full scope of your error from make.

If you have problems at execution, please:

  • attach the stacktrace in case of crash (a coredump would be even better).
  • provide a main that reproduces the error.
    image
    image
@computergeek1507 computergeek1507 added the bug Confirmed bugs or reports that are very likely to be bugs. label Sep 2, 2022
@etr
Copy link
Owner

etr commented Sep 2, 2022

Have you tried looking at how we compile it here: https://github.com/etr/libhttpserver/blob/master/appveyor.yml ?

@computergeek1507
Copy link
Author

I copied the process mostly from the appveryor and it doesn't work on my machine. I have msys2 installed on my Windows D drive, so I don't know if that effects the process.

#!/bin/bash

git clone https://github.com/etr/libhttpserver.git

pacman --noconfirm -S --needed mingw-w64-x86_64-{libtool,make,pkg-config,libsystre,doxygen,gnutls,graphviz,curl}
pacman --noconfirm -S --needed autotools
curl https://s3.amazonaws.com/libhttpserver/libmicrohttpd_releases/libmicrohttpd-0.9.64.tar.gz -o libmicrohttpd-0.9.64.tar.gz
tar -xzf libmicrohttpd-0.9.64.tar.gz
cd libmicrohttpd-0.9.64 && ./configure --disable-examples --enable-poll=no --prefix /D/msys64/mingw64 && make && make install
cd cd .. && cd libhttpserver && ./bootstrap
mkdir build && cd build && MANIFEST_TOOL=no; ../configure --disable-fastopen --prefix /D/msys64/mingw64 CXXFLAGS=-I/D/msys64/mingw64/include LDFLAGS=-L/D/msys64/mingw64/lib; make

@etr
Copy link
Owner

etr commented Sep 9, 2022

Would you mind pasting the entire output of both your configure execution of libmicrohttpd and libhttpserver?

They should be both checking for "winsock2.h" so I am puzzled of why one worked and the other didn't (at configure time).

Maybe looking at what libmicrohttpd is doing can help here.

As aside, can you also search and confirm the location of the "winsock2.h" file on your system?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bugs or reports that are very likely to be bugs.
Projects
None yet
Development

No branches or pull requests

2 participants