当前位置:网站首页>【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 :
边栏推荐
- drawImage方法第一次调用不显示图片的解决方式
- JS regular expression implementation adds a comma to every three digits
- Expose Prometheus metrics in Perl programs
- 海康h9摄像头用xshell无法连接(没有启用ssh)
- The difference between critical section (the code that accesses critical resources in each thread) and mutex (mutex between processes, shared memory, virtual address)
- Systematic explanation of unit testing: mockito
- Understanding and learning of node flow and processing flow in io
- 正则 和 sed 练习
- C语言 pthread_cleanup_push()和pthread_cleanup_pop()函数(用于临界资源程序段中发生终止动作后的资源清理任务,以免造成死锁,临界区资源一般上锁)
- ARP broadcasting practice cases
猜你喜欢

Okaleido ecological core equity Oka, all in fusion mining mode

A small cotton padded jacket with air leakage

Okaleido tiger is about to log in to binance NFT in the second round, which has aroused heated discussion in the community

Chapter 6 Shell Logic and Arithmetic

Cadence (XI) silk screen printing adjustment and subsequent matters

Port forwarding summary

2022 0726 Gu Yujia's study notes

VLAN trunk实验

Okaleido生态核心权益OKA,尽在聚变Mining模式

正则表达式基础整理
随机推荐
Perl: split the external command to be executed into multiple lines
[wsl2] configure the USB camera connecting the USB device and using the host
VLAN trunk experiment
C common function integration-3
Top ten interview questions for software testing (with answers and analysis)
小程序支付管理-新版支付对接流程
Clickhouse notes 1 | introduction, features | installation and use based on centos7 system | common data types | mergetree table engine | SQL operation
js正则表达式实现每三位数字加一个逗号
Tcp/ip protocol analysis (tcp/ip three handshakes & four waves + OSI & TCP / IP model)
用户解锁SM04 SM12
Cadence(十一)丝印调整和后续事项
C language implementation of guessing numbers Games project practice (based on srand function, rand function, switch statement, while loop, if condition criterion, etc.)
Li Mu hands-on learning, in-depth learning, V2 transformer and code implementation
2022-07-25 Gu Yujia's study notes
when的多条件查询
Guava的基础功能与集合
yhb_ sysbench
Quickly update the information in a field in kettle
漏风的小棉袄……
Examples of Oracle triggers