Community
cancel
Showing results for 
Search instead for 
Did you mean: 
ksgokul
Beginner
34 Views

A small bug

Hi,
I was trying to write a program, where i am using both Intel TBB and ACE(Adaptive Communication Environment). I came across an error, where lot of definitions in winsock.h have found its duplicate in winsock2.h.
Intel TBB includes windows.h in my machine and thereby it includes winsock.h, whereas ACE includes winsock2.h. The only solution, i could find in net is to declare winsock2.h before windows.h.
So i made the change in windows_ia32.h and windows_em64.h(both under tbb/machine), to include winsock2.h before windows.h and the errors were stopped. I think this might be a useful change to incorporate. Since TBB is not concerned with socket calls and winsock2.h is a more advanced version than winsock.h, i think this is a change, which won't cause any harm.

Thanks,
Gokul.
0 Kudos
3 Replies
michaelmarcin
Beginner
34 Views

I believe defining WIN32_LEAN_AND_MEAN would also have solved your problem. IIRC it prevents windows.h from including winsock.h.
Dmitry_Vyukov
Valued Contributor I
34 Views

I think you can just include before any TBB headers. Or include ACE headers before TBB headers.

ksgokul
Beginner
34 Views

Thanks. The #define WIN32_LEAN_AND_MEAN solved my problem without the need to touch TBB source.

Thanks,
Gokul.