当前位置:网站首页>Error lnk2019: unresolved external symbol
Error lnk2019: unresolved external symbol
2022-07-07 13:25:00 【Fat Da meow who can fly】
Create project selection dynamic link library dll

Introduce code
#pragma once
#include "pch.h"
#include <string>
#ifdef XSOCKET_EXPORTS
#define XSOCKET_API __declspec(dllexport)
#else
#define XSOCKET_API __declspec(dllimport)
#endif
class XSOCKET_API XTcp
{
public:
int CreateSocket();
bool Bind(unsigned short port);
XTcp Accept();
void Close();
int Recv(char* buf, int bufsize);
int Send(const char* buf, int bufsize);
XTcp();
virtual ~XTcp();
int socketFd = 0;
unsigned short port = 0;
char* ip[16] = {
};
};
Compile error messages
1> Creating library \\192.168.3.15\code\xsocket\x64\Debug\xsocket.lib And the object \\192.168.3.15\code\xsocket\x64\Debug\xsocket.exp
1>XTcp.obj : error LNK2019: Unresolved external symbols __imp_accept, function "public: class XTcp __cdecl XTcp::Accept(void)" (?[email protected]@@QEAA?[email protected]) The symbol is quoted in
1>XTcp.obj : error LNK2019: Unresolved external symbols __imp_bind, function "public: bool __cdecl XTcp::Bind(unsigned short)" (?[email protected]@@[email protected]) The symbol is quoted in
1>XTcp.obj : error LNK2019: Unresolved external symbols __imp_closesocket, function "public: void __cdecl XTcp::Close(void)" (?[email protected]@@QEAAXXZ) The symbol is quoted in
1>XTcp.obj : error LNK2019: Unresolved external symbols __imp_htonl, function "public: bool __cdecl XTcp::Bind(unsigned short)" (?[email protected]@@[email protected]) The symbol is quoted in
1>XTcp.obj : error LNK2019: Unresolved external symbols __imp_htons, function "public: bool __cdecl XTcp::Bind(unsigned short)" (?[email protected]@@[email protected]) The symbol is quoted in
1>XTcp.obj : error LNK2019: Unresolved external symbols __imp_inet_ntoa, function "public: class XTcp __cdecl XTcp::Accept(void)" (?[email protected]@@QEAA?[email protected]) The symbol is quoted in
1>XTcp.obj : error LNK2019: Unresolved external symbols __imp_listen, function "public: bool __cdecl XTcp::Bind(unsigned short)" (?[email protected]@@[email protected]) The symbol is quoted in
1>XTcp.obj : error LNK2019: Unresolved external symbols __imp_ntohs, function "public: class XTcp __cdecl XTcp::Accept(void)" (?[email protected]@@QEAA?[email protected]) The symbol is quoted in
1>XTcp.obj : error LNK2019: Unresolved external symbols __imp_recv, function "public: int __cdecl XTcp::Recv(char *,int)" (?[email protected]@@[email protected]) The symbol is quoted in
1>XTcp.obj : error LNK2019: Unresolved external symbols __imp_send, function "public: int __cdecl XTcp::Send(char const *,int)" (?[email protected]@@[email protected]) The symbol is quoted in
1>XTcp.obj : error LNK2019: Unresolved external symbols __imp_socket, function "public: int __cdecl XTcp::CreateSocket(void)" (?[email protected]@@QEAAHXZ) The symbol is quoted in
1>XTcp.obj : error LNK2019: Unresolved external symbols __imp_WSAStartup, function "public: __cdecl XTcp::XTcp(void)" (??0[email protected]@[email protected]) The symbol is quoted in
1>\\192.168.3.15\code\xsocket\x64\Debug\xsocket.dll : fatal error LNK1120: 12 Unresolved external commands
Try to .h Add... To the file
resolvent
#pragma comment(lib,"ws2_32.lib")
边栏推荐
- leecode3. 无重复字符的最长子串
- 【等保】云计算安全扩展要求关注的安全目标和实现方式区分原则有哪些?
- 滑轨步进电机调试(全国海洋航行器大赛)(STM32主控)
- User management summary of mongodb
- 1. Deep copy 2. Call apply bind 3. For of in differences
- Cloud detection 2020: self attention generation countermeasure network for cloud detection in high-resolution remote sensing images
- Common text processing tools
- Esp32 ① compilation environment
- Practical case: using MYCAT to realize read-write separation of MySQL
- PAcP learning note 1: programming with pcap
猜你喜欢

Go language learning notes - structure

Practical example of propeller easydl: automatic scratch recognition of industrial parts
![[learning notes] zkw segment tree](/img/18/21f455a06e8629243fc5cf4df0044c.png)
[learning notes] zkw segment tree

LIS 最长上升子序列问题(动态规划、贪心+二分)

leecode3. 无重复字符的最长子串

记一次 .NET 某新能源系统 线程疯涨 分析

TPG x AIDU|AI领军人才招募计划进行中!

QQ的药,腾讯的票

MATLAB中polarscatter函数使用

《开源圆桌派》第十一期“冰与火之歌”——如何平衡开源与安全间的天然矛盾?
随机推荐
Cloud detection 2020: self attention generation countermeasure network for cloud detection in high-resolution remote sensing images
Pcap learning notes II: pcap4j source code Notes
我那“不好惹”的00后下属:不差钱,怼领导,抵制加班
Cmake learning and use notes (1)
共创软硬件协同生态:Graphcore IPU与百度飞桨的“联合提交”亮相MLPerf
Esp32 ① compilation environment
Digital IC Design SPI
记一次 .NET 某新能源系统 线程疯涨 分析
Pay close attention to the work of safety production and make every effort to ensure the safety of people's lives and property
存储过程的介绍与基本使用
MySQL入门尝鲜
Esp32 construction engineering add components
将数学公式在el-table里面展示出来
[QNX hypervisor 2.2 user manual]6.3.4 virtual register (guest_shm.h)
【学习笔记】zkw 线段树
User management summary of mongodb
自定义线程池拒绝策略
【黑马早报】华为辟谣“军师”陈春花;恒驰5预售价17.9万元;周杰伦新专辑MV 3小时播放量破亿;法华寺回应万元月薪招人...
[learning notes] agc010
centso7 openssl 报错Verify return code: 20 (unable to get local issuer certificate)