Document on modifying vnc from TCP to UDP (1)

Source: Internet
Author: User

Today, I tried to use enet to rewrite the vnc server so that its transmission protocol was changed from the original TCP protocol to the UDP protocol.
There is no problem with compilation, but the problem occurs again during link, as shown below:
Host. obj: error LNK2019: external symbol that cannot be parsed _ imp _ htonl @ 4, which is referenced in function _ enet_host_connect
Win32.obj: error LNK2019: external symbol that cannot be parsed _ imp _ setsockopt @ 20, which is referenced in function _ enet_socket_create
Win32.obj: error LNK2019: external symbol that cannot be parsed _ imp _ ioctlsocket @ 12, which is referenced in function _ enet_socket_create
.................
Win32.obj: error LNK2019: external symbol that cannot be parsed _ imp _ WSARecvFrom @ 36, which is referenced in function _ enet_socket_receive
Win32.obj: error LNK2019: external symbol that cannot be parsed ___ WSAFDIsSet @ 8, which is referenced in function _ enet_socket_wait
Win32.obj: error LNK2019: external symbol that cannot be parsed _ imp _ select @ 20, which is referenced in function _ enet_socket_wait
. \ Release \ enet. dll: fatal error LNK1120: 26 External commands that cannot be parsed
The generated logs are stored in "file: // c: \ Documents ents and Settings \ juwen \ Desktop \ UltraVNC \ winvnc \ enet \ Release \ BuildLog.htm"
Enet-33 errors and 0 warnings
------ Generation started: Project: authSSP, configuration: Release Win32 ------
Create Buildtime for VERSIONINFO
Buildtime. in
Compiling resources...
Linking...
Creating library. \ .. \ Release/authSSP. lib and object. \ .. \ Release/authSSP. exp
Embedding the list...
The generated logs are stored in "file: // c: \ Documents ents and Settings \ juwen \ Desktop \ UltraVNC \ winvnc \ Release \ BuildLog.htm"
AuthSSP-0 errors and 0 warnings
------ Generated: Project: winvnc, configuration: Release Win32 ------
Executing the pre-link event...
Buildtime. cpp
Linking...
Enet. lib (win32.obj): error LNK2019: the external symbol _ imp _ WSASendTo @ 36 that cannot be parsed. This symbol is referenced in function _ enet_socket_send.
Enet. lib (win32.obj): error LNK2019: the external symbol _ imp _ WSARecvFrom @ 36 that cannot be parsed. This symbol is referenced in function _ enet_socket_receive.
. \ .. \ Release/winvnc.exe: fatal error LNK1120: 2 external commands that cannot be parsed

Among them, _ imq _ WSASendTo @ 36 is caused by the absence of library files to be loaded. The solution can be found inAdd to file
# I nclude <winsock2.h>
# Pragma comment (lib, "ws2_32.lib ")
Or
Project-> Settings-> Link tag-> Object/Library Moduls: Add ws2_32.lib

The problem is solved after adding. The error is as follows:
Win32.obj: error LNK2019: external symbol that cannot be parsed _ imp _ timeBeginPeriod @ 4, which is referenced in function _ enet_initialize
Win32.obj: error LNK2019: external symbol that cannot be parsed _ imp _ timeEndPeriod @ 4, which is referenced in function _ enet_deinitialize
Win32.obj: error LNK2019: external symbol that cannot be parsed _ imp _ timeGetTime @ 0, which is referenced in function _ enet_time_get
. \ Release \ enet. dll: fatal error LNK1120: 3 External commands that cannot be parsed

As long as it is a problem with several time functions, I guess I need to add another library. I found it online. As expected, I added it to the file.
# Pragma comment (lib, "winmm ")
Or
Project-> Settings-> Link tag-> Object/Library Moduls: Add winmm. lib


OK. It took a long time to solve a simple problem! Depressed!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.