[zeromq-dev] Issue with Zmq.hpp - string is not a member of std
Richard_Newton at waters.com
Richard_Newton at waters.com
Wed Jul 3 18:17:20 CEST 2013
Hi,
Pull request https://github.com/zeromq/cppzmq/pull/15 was merge that broke this, there is a pull request pending,
https://github.com/zeromq/cppzmq/pull/22, that fixes this but the C++ bindings tend to be very slow at merging requests.
You can either add a #include <string> to zmq.hpp for now or #include <string> before you #include <zmq.hpp> in your source code.
Ric.
From: "Rajesh Khan" <rajeshkhan808 at gmail.com>
To: zeromq-dev at lists.zeromq.org
Date: 03/07/2013 05:09 PM
Subject: [zeromq-dev] Issue with Zmq.hpp - string is not a member of std
Sent by: zeromq-dev-bounces at lists.zeromq.org
I just downloaded ZMQ from http://www.zeromq.org/intro:get-the-software as a windows source. And I successfully built it.I then downloaded the Zmq.hpp
C++ binding from https://github.com/zeromq/cppzmq and placed it in the zeromq-3.2.3\include folder. I am using VS2010 to test my first example which
is:
#include <zmq.hpp>
#include <string>
#include <iostream>
//#include <windows.h>
using namespace std;
int main ()
{
// Prepare our context and socket
zmq::context_t context (1);
zmq::socket_t socket (context, ZMQ_REP);
socket.bind ("tcp://*:5555");
while (true) {
zmq::message_t request;
// Wait for next request from client
socket.recv (&request);
std::cout << "Received Hello" << std::endl;
// Do some 'work'
//sleep (1);
// Send reply back to client
zmq::message_t reply (5);
memcpy ((void *) reply.data (), "World", 5);
socket.send (reply);
}
return 0;
}
In my VS2010 I included the additional include directories to point to zeromq-3.2.3\include and zeromq-3.2.3\src and I get the following errors when
attempting to build the project
Error 1 error C2039: 'string' : is not a member of 'std' C:\zeromq-3.2.3\include\zmq.hpp 506 1 ZeroMqTest
Error 2 error C2146: syntax error : missing ';' before identifier 'monaddr' C:\zeromq-3.2.3\include\zmq.hpp 506 1 ZeroMqTest
Error 3 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\zeromq-3.2.3\include\zmq.hpp 506
1 ZeroMqTest
Error 4 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\zeromq-3.2.3\include\zmq.hpp 506
1 ZeroMqTest
Error 5 error C2065: 'monaddr' : undeclared identifier C:\zeromq-3.2.3\include\zmq.hpp 369 1 ZeroMqTest
Error 6 error C2039: 'string' : is not a member of 'std' C:\zeromq-3.2.3\include\zmq.hpp 369 1 ZeroMqTest
Error 7 error C3861: 'string': identifier not found C:\zeromq-3.2.3\include\zmq.hpp 369 1 ZeroMqTest
Error 8 error C2065: 'monaddr' : undeclared identifier C:\zeromq-3.2.3\include\zmq.hpp 415 1 ZeroMqTest
Error 9 error C2228: left of '.c_str' must have class/struct/union C:\zeromq-3.2.3\include\zmq.hpp 415 1 ZeroMqTest
Any suggestions on what I might be doing wrong
_______________________________________________
zeromq-dev mailing list
zeromq-dev at lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev
===========================================================
The information in this email is confidential, and is intended solely for the addressee(s).
Access to this email by anyone else is unauthorized and therefore prohibited. If you are
not the intended recipient you are notified that disclosing, copying, distributing or taking
any action in reliance on the contents of this information is strictly prohibited and may be unlawful.
===========================================================
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130703/5d834a81/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130703/5d834a81/attachment.gif>
More information about the zeromq-dev
mailing list