use*_*531 6 c# dllnotfoundexception zeromq unity-game-engine
我正在尝试使用ZeroMQ C#-binding(http://www.zeromq.org/bindings:clr)与我在Unity中创建的游戏服务器进行通信(我使用的是Mac OS X 10.8).因此,我创建了一个简单的函数,它连接到服务器,发送消息然后接收消息:
using UnityEngine;
using System.Runtime.InteropServices;
using System.Collections;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ZeroMQ;
public class NetworkZero : MonoBehaviour {
// Use this for initialization
public static NetworkZero instance;
void Start () {
instance = this;
Debug.Log("START NETWORK COMMUNICATION");
}
// Update is called once per frame
void Update () {
using (ZMQ.Context context = new ZMQ.Context(1))
using (ZMQ.Socket client = context.Socket(ZMQ.SocketType.REQ))
{
string sendMSG = "CLIENT";
client.Connect("tcp://localhost:31415");
client.Bind("tcp://localhost:31415");
client.Send(sendMSG, Encoding.Unicode);
string message = client.Recv(Encoding.Unicode);
Debug.Log("Received request: " + message);
}
}
}
Run Code Online (Sandbox Code Playgroud)
我按照说明在我的项目中包含了必要的库,并在monoDevelop中添加了对这些库的引用.但是在程序构建时,我在尝试运行程序时仍会出现以下错误:
DllNotFoundException: libzmq
ZMQ.Context..ctor (Int32 io_threads)
NetworkZero.Update () (at Assets/SLIP/NetworkZero.cs:26)
Run Code Online (Sandbox Code Playgroud)
有没有人有什么建议?