Can't include afxsock.h if WINVER 0x400

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
<font size=2>Trying to compile a project converted to VS2005 from 6.0.  Defining WINVER to 0x400 to allow win9x.  including afxsock.h gives many errors, pasting first few:</font>
<font size=2></font>  <font size=1>
<font size=2>J:Microsoft Visual Studio 8VCatlmfcincludeatlsocket.inl(116) : error C2065: IPPROTO_IPV6 : undeclared identifier</font>
<font size=2>J:Microsoft Visual Studio 8VCatlmfcincludeafxsock.h(381) : error C2065: SOCKADDR_STORAGE : undeclared identifier</font>
<font size=2>J:Microsoft Visual Studio 8VCatlmfcincludeafxsock.h(381) : error C2146: syntax error : missing ; before identifier sockAddr</font>
<font size=2>J:Microsoft Visual Studio 8VCatlmfcincludeafxsock.h(381) : error C2065: sockAddr : undeclared identifier</font>
<font size=2>J:Microsoft Visual Studio 8VCatlmfcincludeafxsock.h(382) : error C2070: unknown-type: illegal sizeof operand</font>
<font size=2>J:Microsoft Visual Studio 8VCatlmfcincludeafxsock.h(384) : error C2070: unknown-type: illegal sizeof operand</font>
<font size=2></font> 
<font size=2>Many more as well.</font>
<font size=2>If I set WINVER to 0x501, the errors go away.</font>
<font size=2>Is there a way to still target win9x platforms and use afxsock.h?</font>
<font size=2>Thanks!</font> </font>

View the full article
 
Back
Top