VS2010 fatal error C1189

RCF support and general discussion.
Post Reply
zaksoft
Posts: 8
Joined: Sun Mar 25, 2012 3:10 pm

VS2010 fatal error C1189

Post by zaksoft »

Upgrading source from 2.00.2648 to 2.00.2661 I've got this error on VS2010:

RCF\include\RCF/external/asio/asio/detail/socket_types.hpp(22): fatal error C1189: #error : WinSock.h has already been included

Searching on net I've found the causes, but I'm not able (already using WIN32_LEAN_AND_MEAN - other errors putting winsok2.h on top of stdafx.h) to avoid the problem.

Can someone have found a solution ?

TIA

zaksoft
Posts: 8
Joined: Sun Mar 25, 2012 3:10 pm

[Solved]: VS2010 fatal error C1189

Post by zaksoft »

since when adding RCF.cpp to a project this file is marked as "Not Using Precompiled Headers", the line

#ifdef __MSC_VER
#define WIN32_LEAN_AND_MEAN
#endif

must be inserted in RCF.cpp before <boost/config>

This solve the problem.

jarl
Posts: 238
Joined: Mon Oct 03, 2011 4:53 am
Contact:

Re: VS2010 fatal error C1189

Post by jarl »

Yes, you will generally need to have WIN32_LEAN_AND_MEAN defined, when building on Windows. In build 2664, I've changed the error message that emanates from Boost.Asio, to indicate this.

The easiest way to deal with this is to specify WIN32_LEAN_AND_MEAN in your build settings (pass -DWIN32_LEAN_AND_MEAN in as a command line option to the compiler), that way you won't have to modify the source.
Kind Regards

Jarl Lindrud
Delta V Software
http://www.deltavsoft.com

Post Reply