当前位置:网站首页>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")
边栏推荐
猜你喜欢

人均瑞数系列,瑞数 4 代 JS 逆向分析

Esp32 ① compilation environment

My "troublesome" subordinates after 00: not bad for money, against leaders, and resist overtime

Distributed transaction solution

OSI 七层模型

Final review notes of single chip microcomputer principle

Introduce six open source protocols in detail (instructions for programmers)

我那“不好惹”的00后下属:不差钱,怼领导,抵制加班

聊聊伪共享

MySQL入门尝鲜
随机推荐
抓细抓实抓好安全生产各项工作 全力确保人民群众生命财产安全
JNA学习笔记一:概念
LED light of single chip microcomputer learning notes
如何让electorn打开的新窗口在window任务栏上面
Mongodb slice summary
Cmu15445 (fall 2019) project 2 - hash table details
[untitled]
MongoDB内部的存储原理
Shortcut key of Bash
飞桨EasyDL实操范例:工业零件划痕自动识别
《开源圆桌派》第十一期“冰与火之歌”——如何平衡开源与安全间的天然矛盾?
How to make the new window opened by electorn on the window taskbar
shell 批量文件名(不含扩展名)小写改大写
MongoDB复制(副本集)总结
Summary of import, export, backup and recovery of mongodb
centso7 openssl 报错Verify return code: 20 (unable to get local issuer certificate)
一文读懂数仓中的pg_stat
高端了8年,雅迪如今怎么样?
How to reset Google browser? Google Chrome restore default settings?
OSI seven layer model