• 编VC网络程序遇到一个问题,原来是少了一个LIB。


    编VC网络程序遇到一个问题。原来是少了一个WSOCK32.LIB

    告诫一下自己:
         在VC中进行WINSOCK的API编程开发的时候,需要在项目中使用下面三个文件,否则会出现编译错误。
      1.WINSOCK.H: 这是WINSOCK API的头文件,需要包含在项目中。
      2.WSOCK32.LIB: WINSOCK API连接库文件。在使用中,一定要把它作为项目的非缺省的连接库包含到项目文件中去。
      3.WINSOCK.DLL: WINSOCK的动态连接库,位于WINDOWS的安装目录下。


    --------------------Configuration: Example1 - Win32 Debug--------------------
    Linking...
    Client.obj : error LNK2001: unresolved external symbol _connect@12
    Client.obj : error LNK2001: unresolved external symbol _htons@4
    Server.obj : error LNK2001: unresolved external symbol _htons@4
    Client.obj : error LNK2001: unresolved external symbol _inet_addr@4
    Client.obj : error LNK2001: unresolved external symbol _socket@12
    Server.obj : error LNK2001: unresolved external symbol _socket@12
    Client.obj : error LNK2001: unresolved external symbol _closesocket@4
    Example1Dlg.obj : error LNK2001: unresolved external symbol _closesocket@4
    Server.obj : error LNK2001: unresolved external symbol _closesocket@4
    Client.obj : error LNK2001: unresolved external symbol _send@16
    Example1Dlg.obj : error LNK2001: unresolved external symbol _send@16
    Client.obj : error LNK2001: unresolved external symbol _recv@16
    Example1Dlg.obj : error LNK2001: unresolved external symbol _recv@16
    Client.obj : error LNK2001: unresolved external symbol _WSAAsyncSelect@16
    Server.obj : error LNK2001: unresolved external symbol _WSAAsyncSelect@16
    Example1Dlg.obj : error LNK2001: unresolved external symbol _WSAStartup@8
    Example1Dlg.obj : error LNK2001: unresolved external symbol _accept@12
    Server.obj : error LNK2001: unresolved external symbol _listen@8
    Server.obj : error LNK2001: unresolved external symbol _bind@12
    Debug/Example1.exe : fatal error LNK1120: 12 unresolved externals
    Error executing link.exe.

    Example1.exe - 20 error(s), 0 warning(s)

  • 相关阅读:
    Android开发经验小节2:循环利用你的小对象
    新技术你知道吗?Node.js的HelloWorld!
    css添加省略号(twxtoverflow:ellipsis)/图标精灵(background)
    htmlcss优先级(style,id,class,tag,*,继承,!important)
    html标签样式(块,内联,内联块,按内容,按显示分类)
    html浮动(float)
    css盒子模型
    htmlcss继承(inherit)
    htmldisplay(转化元素,block,inline,inlineblock,none)
    html定位position(固定,相对(relative),绝对(absolute))
  • 原文地址:https://www.cnblogs.com/BoyeeStudio/p/294539.html
Copyright © 2020-2023  润新知