Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Error between winsock2.h and ws2def.h

Open
#28 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
networking

Research direction

Start with HttpRequest.cpp and reproduce its Windows compilation with the reported Windows Kits headers. Trace which include brings in winsock.h before ws2def.h, then confirm the 161 duplicate-definition errors are gone while the header still compiles successfully.

Written by the indexing model from the issue text.

Description

I simply include "HttpRequest.cpp" and at compile time I have 161 errors of this type :

1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winsock.h(457): message : voir la définition précédente de 'AF_IPX'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\ws2def.h(147,1): warning C4005: 'AF_MAX' : redéfinition de macro
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winsock.h(476): message : voir la définition précédente de 'AF_MAX'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\ws2def.h(185,1): warning C4005: 'SO_DONTLINGER' : redéfinition de macro
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winsock.h(399): message : voir la définition précédente de 'SO_DONTLINGER'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\ws2def.h(238,25): error C2011: 'sockaddr' : redéfinition du type 'struct'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winsock.h(1007): message : voir la déclaration de 'sockaddr'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\ws2def.h(440,5): error C2143: erreur de syntaxe : absence de '}' avant 'constante'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\ws2def.h(440,27): error C2059: erreur de syntaxe : 'constante'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\ws2def.h(494,1): error C2143: erreur de syntaxe : absence de ';' avant '}'```

I tried a lot of solutions like including windows.h before httprequest.cpp but nothing works
Dominant language
C++
Stars
971
Forks
200
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from elnormous/HTTPRequest

All issues in elnormous/HTTPRequest

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.