当前位置:网站首页>【QT】capture. Obj:-1: error: lnk2019: unresolved external symbols__ imp_ Htons (solution)
【QT】capture. Obj:-1: error: lnk2019: unresolved external symbols__ imp_ Htons (solution)
2022-07-27 07:38:00 【Cappuccino-jay】
In use QT The following error was encountered during socket programming :
1、capture.obj error: LNK2019: Unresolved external symbols __imp_htons, The sign is in the function “public: int __cdecl Capture::ipPackageHandle(unsigned char const *,int &)” ([email protected]@@[email protected]) Cited in
2、capture.obj error: LNK2019: Unresolved external symbols __imp_ntohl, The sign is in the function “public: int __cdecl Capture::tcpPackageHandle(unsigned char const *,class QString &,int)” ([email protected]@@[email protected]@[email protected]) Cited in
3、capture.obj error: LNK2019: Unresolved external symbols __imp_ntohs, The sign is in the function “public: int __cdecl Capture::ethernetPackageHandle(unsigned char const *,class QString &)” ([email protected]@@[email protected]@@Z) Cited in
4、datapackage.obj error: LNK2019: Unresolved external symbols htonl, The sign is in the function “public: bool __cdecl DataPackage::getTcpOperationSACK(int,unsigned char &,class QVector &)” ([email protected]@@[email protected]@@@Z) Cited in
5、datapackage.obj error: LNK2019: Unresolved external symbols inet_ntoa, The sign is in the function “public: class QString __cdecl DataPackage::getDesIpAddr(void)” ([email protected]@@[email protected]@XZ) Cited in
6、datapackage.obj error: LNK2019: Unresolved external symbols ntohl, The sign is in the function “public: class QString __cdecl DataPackage::getTcpSequence(void)” ([email protected]@@[email protected]@XZ) Cited in
7、datapackage.obj error: LNK2019: Unresolved external symbols ntohs, The sign is in the function “public: class QString __cdecl DataPackage::getMacType(void)” ([email protected]@@[email protected]@XZ) Cited in
8、debug\shark.exe error: LNK1120: 7 Unresolved external commands

The solution is as follows :
stay CPP file include Add the following code after the statement :
#pragma comment(lib,"ws2_32.lib")
Indicates when the link is found ws2_32.lib
Then the compilation succeeds :
边栏推荐
- The DrawImage method calls the solution of not displaying pictures for the first time
- 单片机多级菜单
- VLAN trunk experiment
- Haikang H9 camera cannot be connected with xshell (SSH is not enabled)
- 记录一个自己挖的坑~
- Plato farm is expected to further expand its ecosystem through elephant swap
- Okaleido tiger is about to log in to binance NFT in the second round, which has aroused heated discussion in the community
- Functools module
- flink原理(一) 状态的TTL管理、容错机制
- Actual combat of flutter - Request encapsulation (I)
猜你喜欢

(2022杭电多校三)1011.Taxi(曼哈顿最值+二分)

VLAN trunk experiment

冰冰学习笔记:类与对象(中)

C language programming | program compilation and preprocessing

Array method and loop in JS

Expose Prometheus metrics in Perl programs

(2022 Niuke multi school III) j-journey (Dijkstra)

ADC噪声全面分析 -01- ADC噪声的类型以及ADC特性

flink1.14 sql基础语法(一) flink sql表查询详解

Apifox安装及使用
随机推荐
(2022 Hangdian multi school III) 1009.package delivery (greedy)
flink原理(一) 状态的TTL管理、容错机制
Prior Attention Enhanced Convolutional Neural Network Based Automatic Segmentation of Organs at Risk
Use reflection to dynamically modify annotation attributes of @excel
用shell来计算文本中的数字之和
闭散列和开散列解决哈希冲突
opengl-shader学习笔记:varying变量
记录一个自己挖的坑~
shell循环练习
The difference between critical section (the code that accesses critical resources in each thread) and mutex (mutex between processes, shared memory, virtual address)
Multithreading [preliminary - Part 1]
连接MySQL时报错:Public Key Retrieval is not allowed 【解决方法】
Plato Farm有望通过Elephant Swap,进一步向外拓展生态
帮忙发一份招聘,base全国,有兴趣的可以过来看看
mysql备份策略
Single arm routing (explanation + experiment)
Haikang H9 camera cannot be connected with xshell (SSH is not enabled)
glGetUniformLocation,glUniform4f
The error of QT connecting SQLite database and its modification
Help send a recruitment, base all over the country. If you are interested, you can come and have a look