# Did Interfaces change in 4.7.x?

**URL:** <https://forums.unrealengine.com/t/did-interfaces-change-in-4-7-x/25898>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [March 30, 2015, 2:04pm UTC](https://forums.unrealengine.com/t/did-interfaces-change-in-4-7-x/25898 "2015-03-30T14:04:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![maikklein](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/maikklein/32/918666_2.png) [@maikklein](https://forums.unrealengine.com/u/maikklein)\
**Post date:** [March 30, 2015, 2:04pm UTC](https://forums.unrealengine.com/t/did-interfaces-change-in-4-7-x/25898/1 "2015-03-30T14:04:12Z")

</div>

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

It seems to be a bit out of date, especially when we now have different syntax for constructors.

Has anyone figured out how to create interfaces in 4.7.x?

```auto

#pragma once
 
#include "Interact.generated.h"
 
/** Class needed to support InterfaceCast<IToStringInterface>(Object) */
UINTERFACE(MinimalAPI)
class UInteract : public UInterface
{
	GENERATED_UINTERFACE_BODY()
};
 
class IInteract
{
	GENERATED_IINTERFACE_BODY()
  IInteract(const FObjectInitializer& obj = FObjectInitializer::Get());
  virtual void Interact();
};

```

```auto

#include "ShooterGame.h"
#include "Interact.h"

IInteract::IInteract(const FObjectInitializer& obj)
{

}

void IInteract::Interact()
{

}

```

But this code results in a linker error

```auto

error LNK2019: unresolved external symbol "public: __cdecl UInteract::UInteract(class FObjectInitializer const &)" (??0UInteract@@QEAA@AEBVFObjectInitializer@@@Z) referenced in function "void__cdecl InternalConstructor<class UInteract>(class FObjectInitializer const &)" (??$InternalConstructor@VUInteract@@@@YAXAEBVFObjectInitializer@@@Z)

```

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_6334e343](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_6334e343](https://forums.unrealengine.com/u/anonymous_user_6334e343)\
**Post date:** [March 30, 2015, 2:23pm UTC](https://forums.unrealengine.com/t/did-interfaces-change-in-4-7-x/25898/2 "2015-03-30T14:23:40Z")

</div>

You need to change the decleration and defenition.

```auto

IInteract::IInteract(const FObjectInitializer& obj);

IInteract::IInteract(const FObjectInitializer& obj = FObjectInitializer::Get())
{

}

```

is a example.

```auto

UINTERFACE(Blueprintable, Category = "Event Brain, Interfaces")
class MYGAME_API UTimeOfDayEventInterface : public UInterface
{
	GENERATED_UINTERFACE_BODY()

public:
	
};

class ITimeOfDayEventInterface
{
	GENERATED_IINTERFACE_BODY()

public:
	ITimeOfDayEventInterface(const FObjectInitializer & PCIP);

..

};

```

```auto

UTimeOfDayEventInterface::UTimeOfDayEventInterface(const FObjectInitializer & PCIP)
	: Super(PCIP)
{
..
}

// Not sure if this is safe tough, never done it my self but it compiles.
ITimeOfDayEventInterface::ITimeOfDayEventInterface(const FObjectInitializer & PCIP = FObjectInitializer::Get())
{
..
}

```

Hope it helps. 🙂

---

<div class="post-metadata">

**Author:** ![maikklein](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/maikklein/32/918666_2.png) [@maikklein](https://forums.unrealengine.com/u/maikklein)\
**Post date:** [March 30, 2015, 2:40pm UTC](https://forums.unrealengine.com/t/did-interfaces-change-in-4-7-x/25898/3 "2015-03-30T14:40:53Z")

</div>

Thanks for the help. The problem was that the constructor had to be from USomeInterface not ISomeInterface. I should learn to read.
