# Can't compile new C++ project: 'You cannot use raw method delegates with UObjects'

**URL:** <https://forums.unrealengine.com/t/cant-compile-new-c-project-you-cannot-use-raw-method-delegates-with-uobjects/466056>\
**Category:** Platform & Builds\
**Tags:** c-build, engine-compile, unreal-engine, question\
**Created:** [June 4, 2020, 12:33am UTC](https://forums.unrealengine.com/t/cant-compile-new-c-project-you-cannot-use-raw-method-delegates-with-uobjects/466056 "2020-06-04T00:33:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_2be4075c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2be4075c](https://forums.unrealengine.com/u/anonymous_user_2be4075c)\
**Post date:** [June 4, 2020, 12:33am UTC](https://forums.unrealengine.com/t/cant-compile-new-c-project-you-cannot-use-raw-method-delegates-with-uobjects/466056/1 "2020-06-04T00:33:42Z")

</div>

When I attempt to create a new project using 4.25, the compile fails and I am given this error:

> The project could not be compiled. Would you like to open it in Visual Studio?

```
Running D:/Games/UE_4.25/Engine/Binaries/DotNET/UnrealBuildTool.exe Development Win64 -Project="D:/Documents/Unreal Projects/MyProject/MyProject.uproject" -TargetType=Editor -Progress -NoEngineChanges -NoHotReloadFromIDE
Creating makefile for MyProjectEditor (no existing makefile)
@progress push 5%
Parsing headers for MyProjectEditor
  Running UnrealHeaderTool "D:\Documents\Unreal Projects\MyProject\MyProject.uproject" "D:\Documents\Unreal Projects\MyProject\Intermediate\Build\Win64\MyProjectEditor\Development\MyProjectEditor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -abslog="C:\Users\Tom\AppData\Local\UnrealBuildTool\Log_UHT.txt" -installed
Reflection code generated for MyProjectEditor in 9.8892664 seconds
@progress pop
Building MyProjectEditor...
Using Visual Studio 2017 14.13.26132 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128) and Windows 10.0.16299.0 SDK (C:\Program Files (x86)\Windows Kits\10).
Building 9 actions with 12 processes...
  @progress 'Compiling C++ source code...' 0%
  @progress 'Compiling C++ source code...' 11%
  [1/9] Default.rc2
  @progress 'Compiling C++ source code...' 22%
  [2/9] SharedPCH.Engine.ShadowErrors.cpp
  D:\Games\UE_4.25\Engine\Source\Runtime\Core\Public\Delegates/DelegateInstancesImpl.h(397): error C2338: You cannot use raw method delegates with UObjects.
  D:\Games\UE_4.25\Engine\Source\Runtime\Core\Public\Delegates/DelegateInstancesImpl.h(521): note: see reference to class template instantiation 'TBaseRawMethodDelegateInstance<bConst,UserClass,WrappedRetValType(ParamTypes...),VarTypes...>' being compiled

```

I can create new projects with no issue on older versions of the engine, however if I attempt to change the engine version to 4.25 the project will once again not compile, and rebuilding from source manually gives the same error message:

> You cannot use raw method delegates with UObjects

I can create a new Blueprint project in 4.25, but when adding a C++ class I once again cannot compile due to the same issue.

---

<div class="post-metadata">

**Author:** ![Jinc](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jinc/32/750897_2.png) [@Jinc](https://forums.unrealengine.com/u/Jinc)\
**Post date:** [July 22, 2020, 2:44am UTC](https://forums.unrealengine.com/t/cant-compile-new-c-project-you-cannot-use-raw-method-delegates-with-uobjects/466056/2 "2020-07-22T02:44:06Z")

</div>

You need to update Visual Studio to C++ toolchain 14.16.27023 (or later) and Windows SDK 10.0.18362.0 (or later). It is also recommended to start using VS 2019 over 2017.
