nbind icon indicating copy to clipboard operation
nbind copied to clipboard

unresolved external

Open Syn9673 opened this issue 5 years ago • 0 comments

Hello, i'm trying to build this to create a simple ENet Wrapper for node.js And i was wandering why do i keep getting this

main.obj : error LNK2019: unresolved external symbol enet_initialize referenced
 in function "public: static int __cdecl ENet::init(void)" (?init@ENet@@SAHXZ)
[C:\Users\AJ\Desktop\test\build\nbind.vcxproj]

My code is this

#include <iostream>
#include <string>
#include "enet/enet.h"

#pragma comment (lib, "enet.lib")
#pragma comment(lib, "ws2_32.lib")
#pragma comment(lib, "winmm.lib")

struct ENet
{
	static int init()
	{
		if (enet_initialize() != 0)
		{
			return EXIT_FAILURE;
		}

		return 0;
	}
	
	static ENetHost* createServer(ENetHost* server, int port, int clients, int channels, int incoming, int outgoing)
	{
		ENetAddress address;

		address.host = ENET_HOST_ANY;
		address.port = port;

		server = enet_host_create(&address, clients, channels, incoming, outgoing);

		return server;
	}
};

#include "nbind/nbind.h"

NBIND_CLASS(ENet)
{
	method(init);
	//method(createServer);
}

Syn9673 avatar Apr 22 '20 13:04 Syn9673