Hi jinkuncai,
We actually have a bug in the last release where a header file include is missing and can cause compilation errors, like the ones you're seeing, if you only include ws_client.h. This has already been fixed in the development branch and will be in the next release, 2.4.0. The problem is really easy to work around. Add the following includes to your sources before including <cpprest/ws_client.h>:
Steve
We actually have a bug in the last release where a header file include is missing and can cause compilation errors, like the ones you're seeing, if you only include ws_client.h. This has already been fixed in the development branch and will be in the next release, 2.4.0. The problem is really easy to work around. Add the following includes to your sources before including <cpprest/ws_client.h>:
#include <cpprest/streams.h>
#include <cpprest/containerstream.h>
This will get your program compiling. However I also noticed in your code that you are never waiting on any of the asynchronous operations before exiting your main function. This means your program will not run as expected since you will be exiting the process with asynchronous tasks still executing. What you need to do is setup some signaling to wait for when to exit or you need to call wait()/get() on each of the tasks. If you are unfamiliar about programming with tasks I recommend you take a look at this msdn article.Steve