Windows TCP/ip programming - #include <winsock2.h> has funny #define on MinGW 64-bit (MSys2) that can confuse beginner developer's. #123
paule32
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
for those, that would using Turbo'Vision for programming TCP/ip Applications under Windows 10/11 64-bit Professional, the current header source release of the Windows WinSock2 32-Bit has a funny, misspelling typo in winsock2.h.
If you open this file on the source tree of MinGW 64, and navigate to the Line: 13, you can find the pre-processor #define WINSOCKAPI
This macro check, if it already taken, if not then it would be defined.
The funny thing on this is, that, if it is not "defined", it will defined.
On the other Hand: you don't need these 5 Lines of code.
So, I pre-process out comment it with #if 0 ... #ifdef
If you don't do this, the MinGW 64 GNU C++ Compiler will strike the compilation of your source files, and abort the running task.
Here are the source header first lines:
I hope this can help other developers, that working under Microsoft Windows Operating Systems.
paule32
Beta Was this translation helpful? Give feedback.
All reactions