# Trouble using windows includes with DWORD, INT

**URL:** <https://forums.unrealengine.com/t/trouble-using-windows-includes-with-dword-int/280190>\
**Category:** C++\
**Tags:** compilation, windows, unreal-engine, CPP, question\
**Created:** [April 10, 2014, 12:23pm UTC](https://forums.unrealengine.com/t/trouble-using-windows-includes-with-dword-int/280190 "2014-04-10T12:23:50Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nadege\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nadege\_1](https://forums.unrealengine.com/u/Nadege_1)\
**Post date:** [April 10, 2014, 12:23pm UTC](https://forums.unrealengine.com/t/trouble-using-windows-includes-with-dword-int/280190/1 "2014-04-10T12:23:50Z")

</div>

Hello,

I’m trying to use a static library that use some includes files of windows sdk (winsock2.h) but I get compilation errors about ambiguous symbols: DWORD and INT.  
I searched in the documentation and those symbols appears to be, in unreal, [typedef of “FUnusableClass”](https://docs.unrealengine.com/latest/INT/API/Runtime/Core/index.html).

Why prevent the use of those symbols?  
Maybe we are not supposed to use Windows stuff directly and must use Unreal’s instead, [like here](https://answers.unrealengine.com/questions/4399/getting-my-documents-or-appdata-path.html)?

What I’m trying to do is integrate a library we made, based on network library asio ([Asio C++ Library](http://think-async.com/Asio/)), in our unreal project. So what can/should i do?

Nadège

---

<div class="post-metadata">

**Author:** ![Jamie\_Dale](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jamie_dale/32/1165413_2.png) [@Jamie\_Dale](https://forums.unrealengine.com/u/Jamie_Dale)\
**Post date:** [April 10, 2014, 1:04pm UTC](https://forums.unrealengine.com/t/trouble-using-windows-includes-with-dword-int/280190/2 "2014-04-10T13:04:49Z")

</div>

Where we need access to the Windows types in engine, we wrap the include in:

```
#include "AllowWindowsPlatformTypes.h"
#include "MyWindowsStuff.h"
#include "HideWindowsPlatformTypes.h"

```

---

<div class="post-metadata">

**Author:** ![Nadege\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nadege\_1](https://forums.unrealengine.com/u/Nadege_1)\
**Post date:** [April 10, 2014, 1:25pm UTC](https://forums.unrealengine.com/t/trouble-using-windows-includes-with-dword-int/280190/3 "2014-04-10T13:25:31Z")

</div>

nice thank you !

---

<div class="post-metadata">

**Author:** ![gao10211\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gao10211\_1](https://forums.unrealengine.com/u/gao10211_1)\
**Post date:** [September 26, 2014, 8:53am UTC](https://forums.unrealengine.com/t/trouble-using-windows-includes-with-dword-int/280190/4 "2014-09-26T08:53:56Z")

</div>

Where is the MyWindowsStuff.h file?  
I insert the above code but the compile error that “no such or directory about the MyWindowsStuff.h” apeears.

---

<div class="post-metadata">

**Author:** ![Ehamloptiran\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ehamloptiran\_1](https://forums.unrealengine.com/u/Ehamloptiran_1)\
**Post date:** [September 26, 2014, 9:21am UTC](https://forums.unrealengine.com/t/trouble-using-windows-includes-with-dword-int/280190/5 "2014-09-26T09:21:37Z")

</div>

You dont actually include “MyWindowStuff.h” you substitute that for the headers that require windows platform types. So in your case the ffmpeg headers.

---

<div class="post-metadata">

**Author:** ![gao10211\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gao10211\_1](https://forums.unrealengine.com/u/gao10211_1)\
**Post date:** [September 26, 2014, 9:38am UTC](https://forums.unrealengine.com/t/trouble-using-windows-includes-with-dword-int/280190/6 "2014-09-26T09:38:54Z")

</div>

Hi.  
Thanks for your answer.  
I insert ffmpeg headers like this, but errors not disppear.

```
#include "AllowWindowsPlatformTypes.h" 
#include "ffmpeginc.h" 
#include "HideWindowsPlatformTypes.h"

```

there are follow souce code in ffmpeginc.h file

```
    #pragma once 

    #ifdef __cplusplus 
    extern "C" { 

    #include <libavutil/avutil.h> 
    #include <libavutil/imgutils.h> 
    #include <libavcodec/avcodec.h> 
    #include <libavformat/avformat.h> 
    #include <libswscale/swscale.h> 

    } 
    #endif

```

-this is the error  
1\>C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcasync.h(126): error C2872: ‘UINT’ : ambiguous symbol  
1\> could be ‘C:\Program Files (x86)\Windows Kits\8.1\include\shared\minwindef.h(177) : unsigned int UINT’  
1\> or ‘C:\Program Files\Unreal Engine\4.4\Engine\Source\Runtime\Core\Public\Core.h(491) : DoNotUseOldUE4Type::UINT’  
Please explain how can I fix it.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_01dd28a6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_01dd28a6](https://forums.unrealengine.com/u/anonymous_user_01dd28a6)\
**Post date:** [July 7, 2015, 8:28pm UTC](https://forums.unrealengine.com/t/trouble-using-windows-includes-with-dword-int/280190/7 "2015-07-07T20:28:42Z")

</div>

My Version…

In my static blueprint utilities class. Also I use 2 static buffers for the data gets.

in the .h

```
UFUNCTION(BlueprintCallable, Category = TheVoidUtils)
	static FString GetMachineIP();

```

top of the .cpp

```
#include "AllowWindowsPlatformTypes.h"
#include "winsock.h"
#include "HideWindowsPlatformTypes.h"

```

in the .cpp

```
char VOIDIP_hostname[1024];
char VOIDIP_IPSTRING[1024];

FString UUnrealVoidUtils::GetMachineIP()
{
#ifdef WIN32
	WSADATA wsaData;
	WORD wVersionRequested = MAKEWORD(2, 0);
	if (::WSAStartup(wVersionRequested, &wsaData) != 0)
		return FString(TEXT("NO WINSOCK"));
#endif

	if (gethostname(VOIDIP_hostname, sizeof(VOIDIP_hostname)) == SOCKET_ERROR)
	{
#ifdef WIN32
		WSACleanup();
#endif
		return FString(TEXT("WINSOCK ERROR"));
	}
	
	struct hostent *host = gethostbyname(VOIDIP_hostname);
	if (host == NULL)
	{
#ifdef WIN32
		WSACleanup();
#endif
		return FString(TEXT("GET HOST ERROR"));
	}

	sprintf(VOIDIP_IPSTRING, "%d.%d.%d.%d",
		 (int32)(((struct in_addr *)(host->h_addr))->S_un.S_un_b.s_b1),
		 (int32)(((struct in_addr *)(host->h_addr))->S_un.S_un_b.s_b2),
		 (int32)(((struct in_addr *)(host->h_addr))->S_un.S_un_b.s_b3),
		 (int32)(((struct in_addr *)(host->h_addr))->S_un.S_un_b.s_b4));
#ifdef WIN32
	WSACleanup();
#endif

	return FString(VOIDIP_IPSTRING);
}

```
