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:
1> 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).
1>C:\Program Files\boost\boost_1_44\boost/asio/detail/impl/win_thread.ipp(52): error C2664: 'QueueUserAPC' : cannot convert parameter 1 from 'void (__stdcall *)(ULONG_PTR)' to 'PAPCFUNC'
1> Address of a function yields __clrcall calling convention in /clr:pure and /clr:safe; consider using __clrcall in target type
1>C:\Program Files\boost\boost_1_44\boost/asio/detail/impl/win_thread.ipp(82): error C2664: '_beginthreadex' : cannot convert parameter 3 from 'unsigned int (__stdcall *)(void *)' to 'unsigned int (__stdcall *)(void *)'
1> Address of a function yields __clrcall calling convention in /clr:pure and /clr:safe; consider using __clrcall in target type
1>C:\Program Files\boost\boost_1_44\boost/asio/detail/win_thread.hpp(31): error C3641: 'boost::asio::detail::win_thread_function' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
1>C:\Program Files\boost\boost_1_44\boost/asio/detail/win_thread.hpp(36): error C3641: 'boost::asio::detail::apc_function' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
1>C:\Program Files\boost\boost_1_44\boost/asio/detail/win_fenced_block.hpp(35): error C3862: 'boost::asio::detail::win_fenced_block::win_fenced_block': cannot compile an unmanaged function with /clr:pure or /clr:safe
1> Inline native assembly not supported in managed code
1>C:\Program Files\boost\boost_1_44\boost/asio/detail/win_fenced_block.hpp(35): error C3645: 'boost::asio::detail::win_fenced_block::win_fenced_block' : __clrcall cannot be used on functions compiled to native code
1>C:\Program Files\boost\boost_1_44\boost/asio/detail/win_fenced_block.hpp(54): error C3862: 'boost::asio::detail::win_fenced_block::~win_fenced_block': cannot compile an unmanaged function with /clr:pure or /clr:safe
1> Inline native assembly not supported in managed code
1>C:\Program Files\boost\boost_1_44\boost/asio/detail/win_fenced_block.hpp(54): error C3645: 'boost::asio::detail::win_fenced_block::~win_fenced_block' : __clrcall cannot be used on functions compiled to native code
1>
1>Build FAILED.
Any help would be much appreciated.
Cheers,
Alan Vella.
_______________________________________________________
Unlimited Disk, Data Transfer, PHP/MySQL Domain Hosting
http://www.doteasy.com