Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unresolved external #137

Open
Syn9673 opened this issue Apr 22, 2020 · 0 comments
Open

unresolved external #137

Syn9673 opened this issue Apr 22, 2020 · 0 comments

Comments

@Syn9673
Copy link

Syn9673 commented Apr 22, 2020

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);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant