I am trying to get struct pollfd to work. I have defined it in poll.h exactly how it is in winsock2.h, changed my int poll() function to int WSApoll() to conform to the declaration in Winsock2, made sure Winsock2 and WS2tcpip come before windows.h and tried EVERY configuration imaginable. I am at a loss. I keep getting pollfd 'struct' type redefinition in my poll.h file and a use of undefined type 'pollfd' in my cpp file. The commented parts are part of my multiple attempts and the common.h used to house Winsock2.h, WS2tcpip.h and Windows.h. Any thoughts? I have tried not putting the struct in poll.h, which then gives me a 2019 linker error, I have tried so many different ways to fix this that I can't even remember them all at this point. Any help at all is appreciated - TIA!
I apologize, I tried repeatedly to get the code tag to work, but it wouldn't yesterday - I thought it was broken. It worked today though, probably some user error on my part - I blame Monday!
2) from MikeyBoy: pollfd is defined and I am trying to use it from Winsock2, but I am getting an error telling me that I am trying to redefine it, but as far as I can tell from all examples and the way it is written in Winsock2.h, I'm not. That's why I am confused.
Look at lines 9 - 13 of your poll.h. You are defining the struct there. And yet it's already defined in WinSock2.h. So, obviously, you're attempting to redefine a struct that's already defined.
EDIT: Also, from your OP:
which then gives me a 2019 linker error
Do you honestly believe any of us has memorized what all the thousands of numerical error codes from Visual Studio mean?
And:
I have tried not putting the struct in poll.h, which then gives me a 2019 linker error
So, you fixed one error, such that your file compiled properly, then you got another error at link-time, and decided to put back the first error so that your code couldn't even compile again.
Fix your compilation error - which you already know how to do - and then we can deal with the linker error.