How to link ZeroMQ when compiling Matlab/Simulink S-function via 'mex'

When you compile a Matlab or Simulink S-Function using mex, this is how you can link the ZeroMQ library:

First, try whether it works without explicit include and library paths:

If you use czmq in addition to zeromq, you can link both libraries like this:

If you use cppzmq (C++ bindings for ZeroMQ), this is a header-only library hence you don’t need to link it.

Explicitly specifying include and library paths

If that doesn’t work, you can specify the include and library paths like this:

for example:


Check out similar posts by category: Matlab/Simulink, C/C++