当前位置:网站首页>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")
边栏推荐
猜你喜欢
随机推荐
【Presto Profile系列】Timeline使用
About the problem of APP flash back after appium starts the app - (solved)
MongoDB的用户管理总结
工具箱之 IKVM.NET 项目新进展
Unity build error: the name "editorutility" does not exist in the current context
一文读懂数仓中的pg_stat
Mongodb command summary
MongoDB优化的几点原则
ESP32构解工程添加组件
国泰君安证券开户怎么开的?开户安全吗?
RealBasicVSR测试图片、视频
高端了8年,雅迪如今怎么样?
提升树莓派性能的方法
Esp32 series column
Shortcut key of Bash
单片机原理期末复习笔记
MongoDB的导入导出、备份恢复总结
Clion mingw64 Chinese garbled code
JS determines whether an object is empty
人均瑞数系列,瑞数 4 代 JS 逆向分析