#include <cstdlib>
#include <iostream>



#ifndef _DLFCN_WIN32_H
	#define _DLFCN_WIN32_H
	#ifdef _WIN32
		#define WIN32_LEAN_AND_MEAN
		#include <windows.h>
		#include <errno.h>
		#define dlopen(P,G) (void*)LoadLibrary(P)
		#define dlsym(D,F) (void*)GetProcAddress((HMODULE)(D),(F))
		#define dlclose(D) FreeLibrary((HMODULE)(D))
		__inline const char* dlerror() {
			static char szMsgBuf[256];
			FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,NULL,GetLastError(),MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT),szMsgBuf,sizeof szMsgBuf,NULL);
			return szMsgBuf;
		}
	#endif /* _WIN32 */

#endif /* _DLFCN_WIN32_H */


#include <cstdlib>
#include <iostream>
#include "../client/Hash.h"


using namespace std;


int main(int argc, char** argv){


	void* lib_handle;
	create_t* create_Hash;
	destroy_t* destroy_Hash;
	Hash* hash;


	lib_handle = dlopen("Hash", RTLD_LAZY);
    cout << "ERROR = " << 	GetLastError() << endl;
	if (!lib_handle) cerr << "Cannot load library: " << dlerror() << endl;
	dlerror();
	create_Hash = (create_t*) dlsym(lib_handle, "create");
	const char* dlsym_error = dlerror();
	if (dlsym_error) cerr << "Cannot load symbol create: " << dlsym_error << endl;
	destroy_Hash = (destroy_t*) dlsym(lib_handle, "destroy");
	dlsym_error = dlerror();
	if (dlsym_error) cerr << "Cannot load symbol destroy: " << dlsym_error << endl;
	hash = create_Hash();






	return 0;
}

