[zeromq-dev] Code organization

Martin Sustrik sustrik at 250bpm.com
Tue Feb 16 14:05:59 CET 2010

gonzalo diethelm wrote:
>>> I saw a couple of ugly includes like these in zmq_streamer.cpp:
>>>   #include "../../bindings/cpp/zmq.hpp"
>>>   #include "../../foreign/xmlParser/xmlParser.cpp"
>> This is because the build on zmq_streamer is done in the source tree
>> (before the header files are installed).
> Just to clarify, and not to push my point any further, what I meant is
> that source code for zmq and source code using zmq could always use:
>   #include <zmq/zmq.h>
>   #include <zmq/zmq.hpp>
> When compiling zmq in the repo, you could find these files with an
> appropriate -I flag; when compiling code that uses zmq (that is, zmq has
> been installed), same thing. In other words, it would work everywhere
> and it would allow you to have all zmq's header files isolated (which is
> nice). This will be helpful if you ever have a C++ file with a template,
> because you will have to install it when installing zmq.

Well, it's a tradeoff. Either you have relative paths in the source code 
or you have -I options defined with autotools. I personally prefer the 
former because anybody can read C code, however, being able to read 
autotools configure scripts is a skill that's much more rare.

>>> A question: is anybody working on porting zmq to cygwin?
>> Several people have asked this question, but AFAIK nobody's really
>> working at it at the moment.
> I will give it a try; never ported anything with autoconf to cygwin,
> we'll see how it goes.

Great! Thanks.


More information about the zeromq-dev mailing list