x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Can't compile UInterface

Hi, I'm pretty new to UE4 C++ and I have a little problem with an interface. I followed a guide on the wiki and i ended up with this code:

.h

 #pragma once
 
 #include "GamemodeInterface.generated.h"
 
 UINTERFACE(Blueprintable)
 class UGamemodeInterface : public UInterface
 {
     GENERATED_UINTERFACE_BODY()    
 };
 
 class IGamemodeInterface
 {
     GENERATED_IINTERFACE_BODY()
 
 public:
 
     UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "Game Mode")
     void EnemyKilledCallback();
 
     UFUNCTION(BlueprintNativeEvent, BlueprintCallable,Category = "Game Mode")
     void PlayerKilledCallback();
 };


.cpp

 #include "UntillLight.h"
 #include "GamemodeInterface.h"
 
 void IGamemodeInterface::EnemyKilledCallback()
 {
 }
 
 void IGamemodeInterface::PlayerKilledCallback()
 {
 }
 
 UGamemodeInterface::UGamemodeInterface(const class FObjectInizializer& PCIP) : Super(PCIP)
 {
 }

When I try to compile i always get these erros:

 2>D:\Develop\Unreal Projects\UntillLight\Source\UntillLight\GamemodeInterface.cpp(14): error C2511: 'UGamemodeInterface::UGamemodeInterface(const FObjectInizializer &)': overloaded member function not found in 'UGamemodeInterface'
 2>  d:\develop\unreal projects\untilllight\source\untilllight\GamemodeInterface.h(11): note: see declaration of 'UGamemodeInterface'
 2>D:\Develop\Unreal Projects\UntillLight\Source\UntillLight\GamemodeInterface.cpp(15): error C2550: 'UGamemodeInterface::{ctor}': constructor initializer lists are only allowed on constructor definitions
 2>  UntillLight.cpp
 2>  UntillLight.generated.cpp
 2>ERROR : UBT error : Failed to produce item: D:\Develop\Unreal Projects\UntillLight\Binaries\Win64\UE4Editor-UntillLight.dll

What is wrong in my code, i really can't find it?

Product Version: UE 4.12
Tags:
more ▼

asked Jul 28 '16 at 03:57 PM in C++ Programming

avatar image

RickyCoDev
8 1 5 6

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Found the solution. I misspelled FObjectInitializer, I wrote FObjectIniZializer.

more ▼

answered Aug 01 '16 at 08:43 AM

avatar image

RickyCoDev
8 1 5 6

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question