# Adding a UFUNCTION to my UObject Plugin causes build to fail.

**URL:** <https://forums.unrealengine.com/t/adding-a-ufunction-to-my-uobject-plugin-causes-build-to-fail/325265>\
**Category:** Plugins\
**Tags:** uobject, c-build-fail, ufunction, unreal-engine, Plugins, question\
**Created:** [July 14, 2015, 9:15pm UTC](https://forums.unrealengine.com/t/adding-a-ufunction-to-my-uobject-plugin-causes-build-to-fail/325265 "2015-07-14T21:15:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_0d53d466](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_0d53d466](https://forums.unrealengine.com/u/anonymous_user_0d53d466)\
**Post date:** [July 14, 2015, 9:15pm UTC](https://forums.unrealengine.com/t/adding-a-ufunction-to-my-uobject-plugin-causes-build-to-fail/325265/1 "2015-07-14T21:15:08Z")

</div>

Am I not able to have UFunction capabilities with my plugin? The moment I delete the UFUNCTION it build perfectly fine. The error I am getting:

`25>ERROR : UBT error : Failed to produce item: C:\Unreal Source\Unreal 7-13-15\I\Engine\Plugins\Developer\UFileImporter\Binaries\Win64\UE4Editor-UFileImporter.dll 25> Total build time: 43.02 seconds 25>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command "..\..\Build\BatchFiles\Build.bat UE4Editor Win64 Development" exited with code -1.`

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_0d53d466](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_0d53d466](https://forums.unrealengine.com/u/anonymous_user_0d53d466)\
**Post date:** [July 15, 2015, 1:13pm UTC](https://forums.unrealengine.com/t/adding-a-ufunction-to-my-uobject-plugin-causes-build-to-fail/325265/2 "2015-07-15T13:13:16Z")

</div>

UCLASS(BlueprintType)  
class UMyFileImporter : public UObject  
{  
GENERATED\_UCLASS\_BODY()

```
public:
	UFUNCTION(BlueprintCallable, Category = "Import")
	//UFUNCTION()
	void Import(const FString Path);
private:

};

```

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_0d53d466](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_0d53d466](https://forums.unrealengine.com/u/anonymous_user_0d53d466)\
**Post date:** [July 15, 2015, 2:26pm UTC](https://forums.unrealengine.com/t/adding-a-ufunction-to-my-uobject-plugin-causes-build-to-fail/325265/3 "2015-07-15T14:26:20Z")

</div>

Would plugins be able to find classes like UTexture2D or UMaterials?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [July 15, 2015, 9:27pm UTC](https://forums.unrealengine.com/t/adding-a-ufunction-to-my-uobject-plugin-causes-build-to-fail/325265/4 "2015-07-15T21:27:00Z")

</div>

Hey

When you say you delete the UFUNCTION are you referring to the commented section of what you posted or the line above that?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_0d53d466](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_0d53d466](https://forums.unrealengine.com/u/anonymous_user_0d53d466)\
**Post date:** [July 16, 2015, 1:14pm UTC](https://forums.unrealengine.com/t/adding-a-ufunction-to-my-uobject-plugin-causes-build-to-fail/325265/5 "2015-07-16T13:14:53Z")

</div>

I had tried out both to see if it would make a difference but it didn’t. For either one, they both still cause the error

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [July 23, 2015, 8:57pm UTC](https://forums.unrealengine.com/t/adding-a-ufunction-to-my-uobject-plugin-causes-build-to-fail/325265/6 "2015-07-23T20:57:05Z")

</div>

Hey

I’m still investigating what could be causing the compile to fail for you however I need more information to make sure I’m understanding what is going on clearly. Could you post the entire output log from when the compile failed? Additionally could you post the full header for the plugin?

It may be that you will have to add dependency for “CoreUObject” to the .cs file for your plugin. You may also need to make sure that an #include of the .generated.h is added. You’ll also need to add the \*\_API markup on the class or method if you are exposing this to the editor in any way. These suggestions are worth testing if you have the chance however more information will help narrow down the cause.

Cheers

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_0d53d466](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_0d53d466](https://forums.unrealengine.com/u/anonymous_user_0d53d466)\
**Post date:** [July 24, 2015, 1:05pm UTC](https://forums.unrealengine.com/t/adding-a-ufunction-to-my-uobject-plugin-causes-build-to-fail/325265/7 "2015-07-24T13:05:39Z")

</div>

I think there was something wrong with my .cs file. I just retyped everything in there and it started working. Maybe something was misspelled
