[zeromq-dev] ZeroMQ chat example runtime error in Windows MS Visual C++ 2005

Martin Sustrik sustrik at fastmq.com
Thu Oct 1 10:35:34 CEST 2009


Hi,

We have no MSVC 2005 installation here so it's hard to say if there's a 
MSVC2005 related problem. Anyway, I recall someone have build the 
project using MSVC2005 some time ago.

> I am new here, so pls bare with me if this has already been discussed.
> 
> I was trying to build the chatroom example provided by the ZeroMQ 
> package using MS Visual C++ 2005 and I ran into runtime error. A debug 
> brings me to a "poller.hpp" line 256:
> 
> // Main event loop
> while (true)
> {
>     if (event_monitor.process_events (this. !timers.empty () ) )
>         break;
> }

Can you be more specific about what kind of runtime error you've got? 
Acces violation? Calling pure virtual function? Also, call stack 
backtrace would help to identify the problem.

> Looking at the tutorial, I suspect the error caused by the fact that the 
> chatroom needs to be built with pthread which is not available in MS 
> Visual C++ 2005. Since my project requires my application to be built in 
> MS Visual C++ 2005, does anyone know if theres a way to work around it 
> so that i can use ZeroMQ in MS Visual C++ 2005. Help with explaination 
> will be much appreciated. Thank you.

Pthread library should not be used on Win platform. If you have a look 
at the code, you'll notice that the sections using pthread functions 
look like this:

#if defined ZMQ_HAVE_WINDOWS
  .... native Win32 call ...
#else
  .... pthread call ...
#endif

Martin




More information about the zeromq-dev mailing list