Uploaded image for project: 'libzmq'
  1. LIBZMQ-342

Cannot build against zmq.hpp in zmq 2.1 under c++11

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.11
    • Fix Version/s: 2.2.0
    • Component/s: core
    • Labels:
      None
    • Environment:

      gcc 4.4

      Description

      Basically, the problem is as outlined here:

      https://github.com/zeromq/zeromq2-1/pull/42

      If I try to compile against zmq.hpp in C++11, I get this:

      $ g++ -std=c++0x main.cpp -I$HOME/zmqtest/include/
      In file included from main.cpp:1:
      /home/yi/zmqtest/include/zmq.hpp: In member function ‘zmq::context_t& zmq::context_t::operator=(zmq::context_t&&)’:
      /home/yi/zmqtest/include/zmq.hpp:207: error: ‘swap’ is not a member of ‘std’
      /home/yi/zmqtest/include/zmq.hpp: In member function ‘zmq::socket_t& zmq::socket_t::operator=(zmq::socket_t&&)’:
      /home/yi/zmqtest/include/zmq.hpp:254: error: ‘swap’ is not a member of ‘std’

      where main.cpp looks like this:

      $ cat main.cpp
      #include <zmq.hpp>

      int main() {
      }

      The fix is to add an algorithm include into zmq.hpp

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              yiding Yi Ding
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: