Re: [Boost-users] boost::asio from C++ Forms App in VS 2010

On 2/25/2011 3:18 PM, Alan Vella wrote:
Hi all,
I'm trying to port a C++ project from gcc (on MinGW) to Visual Studio 2010 inside a Visual C++ Windows Forms application. The code was originally written on a Windows XP 32-bit machine. Now it is being ported into a Windows 7 32-bit machine. This project uses quite a few boost libraries, including the boost::asio library. When I try to compile the code in VS2010 I get the following errors:
If it's an option, you might try VS2008. I've had boost related compile failures on VS2010 with code that compiles and runs fine on VS2008.
Hi Dave, Thanks for your reply. Unfortunately compiling the code in VS2008 throws the same kind of errors + more! Did nobody ever come across these errors? The first lines seem to point towards a solution: Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. For example: 1> - add -D_WIN32_WINNT=0x0501 to the compiler command line; or 1> - add _WIN32_WINNT=0x0501 to your project's Preprocessor Definitions. 1> Assuming _WIN32_WINNT=0x0501 (i.e. Windows XP target). But I'm not sure what they mean. Regards, Alan. _______________________________________________________ Unlimited Disk, Data Transfer, PHP/MySQL Domain Hosting http://www.doteasy.com

On 2/28/2011 3:22 AM, Alan Vella wrote:
Hi Dave,
Thanks for your reply. Unfortunately compiling the code in VS2008 throws the same kind of errors + more! Did nobody ever come across these errors? The first lines seem to point towards a solution:
Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. For example: 1> - add -D_WIN32_WINNT=0x0501 to the compiler command line; or 1> - add _WIN32_WINNT=0x0501 to your project's Preprocessor Definitions. 1> Assuming _WIN32_WINNT=0x0501 (i.e. Windows XP target).
But I'm not sure what they mean.
Regards,
Alan.
Alan, From what I see in the code and the mailing lists, the _WIN32_WINNT definition specifies the "earliest" operating system that you are building your code for. If you want your code to run on Windows XP or later, specify _WIN32_WINNT=0x0501 . If you don't do this, the asio code will assume _WIN32_WINNT=0x0501 but gives a warning (not an error) letting you know that this assumption is being made. That is what you are seeing in these two lines. It probably has nothing to do with the later errors you are seeing. To get rid of these warnings in VS, go to the Property form for your project, and in "Configuration Properties, C/C++, Preprocessor, Preprocessor Definitions" enter _WIN32_WINNT=0x0501 . Again, it probably has nothing to do with the later errors but it should help clean things up a little. - Dave
participants (2)
-
Alan Vella
-
Dave