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

Error between winsock2.h and ws2def.h #28

Open
landscht opened this issue Feb 19, 2021 · 2 comments
Open

Error between winsock2.h and ws2def.h #28

landscht opened this issue Feb 19, 2021 · 2 comments

Comments

@landscht
Copy link

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
@AVISIX
Copy link

AVISIX commented Aug 26, 2021

I have the same issue.

Anyone got a clue how this can be resolved?

@ghost
Copy link

ghost commented Oct 19, 2021

#define WIN32_LEAN_AND_MEAN
#include <HTTPRequest.hpp>
#pragma comment(lib, "ws2_32.lib")

@azzlak azzlak mentioned this issue May 24, 2022
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

No branches or pull requests

2 participants