www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - import libzmq_d.dll for zmq3.2.0

reply =?UTF-8?B?IuaLlueLl+aVo+atpSI=?= <djj shumtn.com> writes:
1、use vs2010 build zmq3.2.0

get libzmq_d.dll file, libzmq_d.dll extern "C" void zmq_version 
(int *major, int *minor, int *patch);

2、implib libzmq_d.lib libzmq_d.dll

get libzmq_d.lib file

3、create zmq.d
module zmq

version (Windows)
{
	pragma (lib, "libzmq_d.lib");
}

extern (C):
void zmq_version (int *major, int *minor, int *patch);

4、dmd -lib zmq.d or dmd -lib zmq.d libzmq_d.lib

get zmq.lib file

5、create main.d file
import zmq;
void main()
{
     int major, minor, patch;
     zmq_version(&major, &minor, &patch);
     printf("Current ZMQ version is %d.%d.%d\n", major, minor, 
patch);
}

6、An Error:
	 Symbol Undefined _zmq_version

Why is that?
help me!
Do not reference dll? bug?
Aug 19 2012
next sibling parent reply mta`chrono <chrono mta-international.net> writes:
I'm not a windows user but since nobody has answered yet, I'll give you
my 50 cents.

It requires a reference "_zmq_version" while the original function is
called "zmq_version". You'll need some kind of linker file. But don't
quote me on that!
Aug 19 2012
parent =?UTF-8?B?IuaLlueLl+aVo+atpSI=?= <djj shumtn.com> writes:
On Sunday, 19 August 2012 at 18:52:37 UTC, mta`chrono wrote:
 I'm not a windows user but since nobody has answered yet, I'll 
 give you
 my 50 cents.

 It requires a reference "_zmq_version" while the original 
 function is
 called "zmq_version". You'll need some kind of linker file. But 
 don't
 quote me on that!
I do not slow connection, brothers!
Aug 19 2012
prev sibling parent reply Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
On 8/19/12, "=E6=8B=96=E7=8B=97=E6=95=A3=E6=AD=A5" <djj shumtn.com> wrote:
 1=E3=80=81use vs2010 build zmq3.2.0

 get libzmq_d.dll file, libzmq_d.dll extern "C" void zmq_version
 (int *major, int *minor, int *patch);

 2=E3=80=81implib libzmq_d.lib libzmq_d.dll
Try: implib libzmq_d.lib libzmq_d.dll /system
Aug 19 2012
next sibling parent =?UTF-8?B?IuaLlueLl+aVo+atpSI=?= <djj shumtn.com> writes:
On Sunday, 19 August 2012 at 19:14:43 UTC, Andrej Mitrovic wrote:
 On 8/19/12, "拖狗散步" <djj shumtn.com> wrote:
 1、use vs2010 build zmq3.2.0

 get libzmq_d.dll file, libzmq_d.dll extern "C" void zmq_version
 (int *major, int *minor, int *patch);

 2、implib libzmq_d.lib libzmq_d.dll
Try: implib libzmq_d.lib libzmq_d.dll /system
I went home to try it, I will timely feedback!Thank you, brother!
Aug 19 2012
prev sibling parent =?UTF-8?B?IuaLlueLl+aVo+atpSI=?= <djj shumtn.com> writes:
On Sunday, 19 August 2012 at 19:14:43 UTC, Andrej Mitrovic wrote:
 On 8/19/12, "拖狗散步" <djj shumtn.com> wrote:
 1、use vs2010 build zmq3.2.0

 get libzmq_d.dll file, libzmq_d.dll extern "C" void zmq_version
 (int *major, int *minor, int *patch);

 2、implib libzmq_d.lib libzmq_d.dll
Try: implib libzmq_d.lib libzmq_d.dll /system
Thank you, brothers, to determine is your reason! Thank you very much! Hey!I was awkward! Forget to add /System Parameters!
Aug 20 2012