This is how I have my headers now #include <string> #include <iostream> #include <zmq.hpp> I am still using the same zmq.hpp file. Now I am getting the following error
Error 1 error LNK2019: unresolved external symbol __imp__zmq_msg_init referenced in function "public: __thiscall zmq::message_t::message_t(void)" (??0message_t@zmq@@QAE@XZ) c:\Users\User\documents\visual studio 2010\Projects\ZeroMqTest\ZeroMqTest\main.obj ZeroMqTest Error 2 error LNK2019: unresolved external symbol __imp__zmq_errno referenced in function "public: __thiscall zmq::error_t::error_t(void)" (??0error_t@zmq@@QAE@XZ) c:\Users\User\documents\visual studio 2010\Projects\ZeroMqTest\ZeroMqTest\main.obj ZeroMqTest Error 3 error LNK2019: unresolved external symbol __imp__zmq_strerror referenced in function "public: virtual char const * __thiscall zmq::error_t::what(void)const " (?what@error_t@zmq@@UBEPBDXZ) c:\Users\User\documents\visual studio 2010\Projects\ZeroMqTest\ZeroMqTest\main.obj ZeroMqTest Error 4 error LNK2019: unresolved external symbol __imp__zmq_msg_init_size referenced in function "public: __thiscall zmq::message_t::message_t(unsigned int)" (??0message_t@zmq@@QAE@I@Z) c:\Users\User\documents\visual studio 2010\Projects\ZeroMqTest\ZeroMqTest\main.obj ZeroMqTest Error 5 error LNK2019: unresolved external symbol __imp__zmq_msg_close referenced in function "public: __thiscall zmq::message_t::~message_t(void)" (??1message_t@zmq@@QAE@XZ) c:\Users\User\documents\visual studio 2010\Projects\ZeroMqTest\ZeroMqTest\main.obj ZeroMqTest Error 6 error LNK2019: unresolved external symbol __imp__zmq_msg_data referenced in function "public: void * __thiscall zmq::message_t::data(void)" (?data@message_t@zmq@@QAEPAXXZ) c:\Users\User\documents\visual studio 2010\Projects\ZeroMqTest\ZeroMqTest\main.obj ZeroMqTest Error 7 error LNK2019: unresolved external symbol __imp__zmq_init referenced in function "public: __thiscall zmq::context_t::context_t(int)" (??0context_t@zmq@@QAE@H@Z) c:\Users\User\documents\visual studio 2010\Projects\ZeroMqTest\ZeroMqTest\main.obj ZeroMqTest Error 8 error LNK2019: unresolved external symbol __imp__zmq_term referenced in function "public: void __thiscall zmq::context_t::close(void)" (?close@context_t@zmq@@QAEXXZ) c:\Users\User\documents\visual studio 2010\Projects\ZeroMqTest\ZeroMqTest\main.obj ZeroMqTest Error 9 error LNK2019: unresolved external symbol __imp__zmq_socket referenced in function "public: __thiscall zmq::socket_t::socket_t(class zmq::context_t &,int)" (??0socket_t@zmq@@QAE@AAVcontext_t@1@H@Z) c:\Users\User\documents\visual studio 2010\Projects\ZeroMqTest\ZeroMqTest\main.obj ZeroMqTest Error 10 error LNK2019: unresolved external symbol __imp__zmq_close referenced in function "public: void __thiscall zmq::socket_t::close(void)" (?close@socket_t@zmq@@QAEXXZ) c:\Users\User\documents\visual studio 2010\Projects\ZeroMqTest\ZeroMqTest\main.obj ZeroMqTest Error 11 error LNK2019: unresolved external symbol __imp__zmq_bind referenced in function "public: void __thiscall zmq::socket_t::bind(char const *)" (?bind@socket_t@zmq@@QAEXPBD@Z) c:\Users\User\documents\visual studio 2010\Projects\ZeroMqTest\ZeroMqTest\main.obj ZeroMqTest Error 12 error LNK2019: unresolved external symbol __imp__zmq_msg_send referenced in function "public: bool __thiscall zmq::socket_t::send(class zmq::message_t &,int)" (?send@socket_t@zmq@ @QAE_NAAVmessage_t@2@H@Z) c:\Users\User\documents\visual studio 2010\Projects\ZeroMqTest\ZeroMqTest\main.obj ZeroMqTest Error 13 error LNK2019: unresolved external symbol __imp__zmq_msg_recv referenced in function "public: bool __thiscall zmq::socket_t::recv(class zmq::message_t *,int)" (?recv@socket_t@zmq@ @QAE_NPAVmessage_t@2@H@Z) c:\Users\User\documents\visual studio 2010\Projects\ZeroMqTest\ZeroMqTest\main.obj ZeroMqTest Error 14 error LNK1120: 13 unresolved externals c:\users\user\documents\visual studio 2010\Projects\ZeroMqTest\Debug\ZeroMqTest.exe ZeroMqTest On Wed, Jul 3, 2013 at 12:17 PM, <[email protected]> wrote: > Hi, > > Pull request > *https://github.com/zeromq/cppzmq/pull/15*<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*<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. > > > [image: Inactive hide details for "Rajesh Khan" ---03/07/2013 05:09:17 > PM---I just downloaded ZMQ from http://www.zeromq.org/intro:get-]"Rajesh > Khan" ---03/07/2013 05:09:17 PM---I just downloaded ZMQ from > http://www.zeromq.org/intro:get-the-software as a windows source. And I s > > From: "Rajesh Khan" <[email protected]> > To: [email protected] > Date: 03/07/2013 05:09 PM > Subject: [zeromq-dev] Issue with Zmq.hpp - string is not a member of std > Sent by: [email protected] > ------------------------------ > > > > I just downloaded ZMQ from > *http://www.zeromq.org/intro:get-the-software*<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*<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 > [email protected] > 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. > =========================================================== > > > _______________________________________________ > zeromq-dev mailing list > [email protected] > http://lists.zeromq.org/mailman/listinfo/zeromq-dev > >
<<graycol.gif>>
_______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
