当前位置:网站首页>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")
边栏推荐
- 【学习笔记】zkw 线段树
- Digital IC Design SPI
- JS slow motion animation principle teaching (super detail)
- MongoDB优化的几点原则
- Unity build error: the name "editorutility" does not exist in the current context
- Signal strength (RSSI) knowledge sorting
- My "troublesome" subordinates after 00: not bad for money, against leaders, and resist overtime
- JS中为什么基础数据类型可以调用方法
- Simple and easy-to-use code specification
- Milkdown 控件图标
猜你喜欢
随机推荐
共创软硬件协同生态:Graphcore IPU与百度飞桨的“联合提交”亮相MLPerf
OSI 七层模型
leecode3. 无重复字符的最长子串
Differences between MySQL storage engine MyISAM and InnoDB
【Presto Profile系列】Timeline使用
Scrapy教程经典实战【新概念英语】
为租客提供帮助
How far can it go to adopt a cow by selling the concept to the market?
Awk of three swordsmen in text processing
[untitled]
Esp32 construction engineering add components
shell 批量文件名(不含扩展名)小写改大写
PAcP learning note 3: pcap method description
clion mingw64中文乱码
[dark horse morning post] Huawei refutes rumors about "military master" Chen Chunhua; Hengchi 5 has a pre-sale price of 179000 yuan; Jay Chou's new album MV has played more than 100 million in 3 hours
PACP学习笔记三:PCAP方法说明
MongoDB命令汇总
RealBasicVSR测试图片、视频
ESP32系列专栏
How to reset Firefox browser