Skip to content

unresolved external #137

@Syn9673

Description

@Syn9673

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);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions