Winsock.h has already been included : OSC block Visual Studio 2015


#1

Trying to add OSC sender to my app based on Cinder-KCB2 block.

After adding osc paths into the project settings, and including Osc.h into my app, I get a fatal error

1>C:\Users\eight_io\devel\cinder_0.9.1_vc2013\include\asio/detail/config.hpp(300): warning C4005: ‘ASIO_ERROR_CATEGORY_NOEXCEPT’: macro redefinition
1> C:\Users\eight_io\devel\cinder_0.9.1_vc2013\include\asio/detail/config.hpp(286): note: see previous definition of ‘ASIO_ERROR_CATEGORY_NOEXCEPT’
1>C:\Users\eight_io\devel\cinder_0.9.1_vc2013\include\asio/detail/socket_types.hpp(24): fatal error C1189: #error: WinSock.h has already been included
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Google tells me to add

#define WIN32_LEAN_AND_MEAN

before

#include <windows.h>

but that does not fix the error.

I also confirmed all my project settings against Osc’s SimpleReceiver sample (which works), but to no avail.

I would appreciate any pointers as to how to fix this.

Thanks!

–8


#2

Well, It turns out I had a bunch of includes I did not see (I am new to windows and visual studio), after removing those, including windows.h – everything compiles.

Sorry for the noise.