Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. compilation errors when including both winsock.h && Ws2tcpip.h in my .cpp file.

compilation errors when including both winsock.h && Ws2tcpip.h in my .cpp file.

Scheduled Pinned Locked Moved C / C++ / MFC
csharpc++visual-studiohelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    VCSharp007
    wrote on last edited by
    #1

    Hi, I got some compilation errors when including both winsock.h && Ws2tcpip.h in my .cpp file. Eg: "C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\Ws2tcpip.h(28) : error C2011: 'ip_mreq' : 'struct' type redefinition 1> C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(372) : see declaration of 'ip_mreq' 1>C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\Ws2tcpip.h(71) : warning C4005: 'IP_TOS' : macro redefinition 1> C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(361) : see previous definition of 'IP_TOS'" so on..... I am using visual studio-2005. Thanx in Advance.

    N 1 Reply Last reply
    0
    • V VCSharp007

      Hi, I got some compilation errors when including both winsock.h && Ws2tcpip.h in my .cpp file. Eg: "C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\Ws2tcpip.h(28) : error C2011: 'ip_mreq' : 'struct' type redefinition 1> C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(372) : see declaration of 'ip_mreq' 1>C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\Ws2tcpip.h(71) : warning C4005: 'IP_TOS' : macro redefinition 1> C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(361) : see previous definition of 'IP_TOS'" so on..... I am using visual studio-2005. Thanx in Advance.

      N Offline
      N Offline
      Nibu babu thomas
      wrote on last edited by
      #2

      Instead of winsock.h include winsock2.h

      #include "winsock2.h"
      #include "ws2tcpip.h"


      Nibu thomas A Developer Programming tips[^]  My site[^]

      V 1 Reply Last reply
      0
      • N Nibu babu thomas

        Instead of winsock.h include winsock2.h

        #include "winsock2.h"
        #include "ws2tcpip.h"


        Nibu thomas A Developer Programming tips[^]  My site[^]

        V Offline
        V Offline
        VCSharp007
        wrote on last edited by
        #3

        oop! Thanx Nibu..

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups