www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Creation of 0MQ D project

reply "Evan Lowry" <lowry.e gmail.com> writes:
Hey all,

I've been playing around w/ D for a little while, and figured I 
would dive more into it with some side project stuff that has 
come up at work. The interface I am hooking up to is a zmq 
server, so I created a dub.json file ~ as follows:

{
     "dependencies": {
         "zeromq": "~master",
     },
     "libs": ["zmq"]
}

and tried to compile by calling 'dub'. I receive the following 
error:

Building zeromq ~master configuration "library", build type debug.
Running dmd...
../../.dub/packages/zeromq-master/deimos/zmq/zmq.d(96): Error: 
function deimos.zmq.zmq.zmq_strerror without 'this' cannot be 
const
FAIL 
../../.dub/packages/zeromq-master/.dub/build/library-debug-linux.posix-x86_64-dmd_2066-9416B6A4CCF69
9BD83BEC040E325AC7/ 
zeromq staticLibrary
Error executing command run: dmd failed with exit code 1.

The 0mq library exists and is linkable:
ls /usr/lib/libzmq.*
/usr/lib/libzmq.a  /usr/lib/libzmq.so  /usr/lib/libzmq.so.4  
/usr/lib/libzmq.so.4.0.0

The error looks to be related to the library code, but I figure 
I'm just doing something stupid in build -- as there seem to be 
no other topics about this.

Any help would be appreciated, sorry for any glaring oversights!
Oct 27 2014
parent reply "anonymous" <anonymous example.com> writes:
On Monday, 27 October 2014 at 23:56:11 UTC, Evan Lowry wrote:
 ../../.dub/packages/zeromq-master/deimos/zmq/zmq.d(96): Error: 
 function deimos.zmq.zmq.zmq_strerror without 'this' cannot be 
 const
You found a bug in the binding. Line 96 of zmq.d [1]: const char* zmq_strerror(int errnum); Should be: const(char)* zmq_strerror(int errnum); I think until recently dmd would accept and ignore const on a free function, and that's how the bug got through. [1] https://github.com/D-Programming-Deimos/ZeroMQ/blob/79fb14b880c172e9aba9701366fd9bc15a8644b1/deimos/zmq/zmq.d#L96
Oct 27 2014
next sibling parent reply "Evan Lowry" <lowry.e gmail.com> writes:
On Tuesday, 28 October 2014 at 00:21:20 UTC, anonymous wrote:
 Line 96 of zmq.d [1]: const char* zmq_strerror(int errnum);
 Should be: const(char)* zmq_strerror(int errnum);
Yep, this seemed to do the trick cleanly. S'all compiling and the examples provided in the repo run. Can submit a pull request, if no-one else has one lined up. Much thanks!
Oct 27 2014
parent Matt Soucy <msoucy csh.rit.edu> writes:
On 10/27/2014 09:02 PM, Evan Lowry wrote:
 On Tuesday, 28 October 2014 at 00:21:20 UTC, anonymous wrote:
 Line 96 of zmq.d [1]: const char* zmq_strerror(int errnum);
 Should be: const(char)* zmq_strerror(int errnum);
=20 Yep, this seemed to do the trick cleanly. S'all compiling and the examp=
les provided in the repo run. Can submit a pull request, if no-one else h= as one lined up.
=20
 Much thanks!
=46rom the original commit that caused that, it seems that const(char)* w= as meant for that statement..? --=20 Matt Soucy http://msoucy.me/
Oct 27 2014
prev sibling parent "Marc =?UTF-8?B?U2Now7x0eiI=?= <schuetzm gmx.net> writes:
On Tuesday, 28 October 2014 at 00:21:20 UTC, anonymous wrote:
 On Monday, 27 October 2014 at 23:56:11 UTC, Evan Lowry wrote:
 ../../.dub/packages/zeromq-master/deimos/zmq/zmq.d(96): Error: 
 function deimos.zmq.zmq.zmq_strerror without 'this' cannot be 
 const
You found a bug in the binding. Line 96 of zmq.d [1]: const char* zmq_strerror(int errnum); Should be: const(char)* zmq_strerror(int errnum);
Ceterum censeo ... https://github.com/D-Programming-Language/dmd/pull/4043
Oct 28 2014