Errors when compiling the Blank Plugin

Having an issue, with compiling up the Blank plugin, after I have put one Declaration in the default .h file.

Error Messages

1>------ Build started: Project: BcBpLibraryV1_1, Configuration: Development_Editor x64 ------
1> Performing 3 actions (4 in parallel)
1> PCH.BpLibraryTestPrivatePCH.h.cpp
1>G:\Epic.Submission\BcBpLibraryV1_1\Plugins\BpLibraryTest\Source\BpLibraryTest\Public\BpLibraryTest.h(20): error C2143: syntax error : missing ‘;’ before ‘’
1>G:\Epic.Submission\BcBpLibraryV1_1\Plugins\BpLibraryTest\Source\BpLibraryTest\Public\BpLibraryTest.h(20): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1> -------- End Detailed Actions Stats -----------------------------------------------------------
1>ERROR : UBT error : Failed to produce item: G:\Epic.Submission\BcBpLibraryV1_1\Plugins\BpLibraryTest\Binaries\Win64\UE4Editor-BpLibraryTest.pdb
1> Total build time: 31.86 seconds
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command ““G:\unreal4.launch\Epic Games\4.9\Engine\Build\BatchFiles\Build.bat” BcBpLibraryV1_1Editor Win64 Development “G:\Epic.Submission\BcBpLibraryV1_1\BcBpLibraryV1_1.uproject” -rocket -waitmutex” exited with code -1.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

UE4 Version: 4.9.2
Visual Studio Version: Visual Studio 2013, Update 5 (same thing occurs with update 4)

Microsoft Visual Studio Express 2013 for Windows Desktop
Version 12.0.40629.00 Update 5
Microsoft .NET Framework
Version 4.5.51209

Installed Version: Desktop Express

Team Explorer for Visual Studio 2013 06157-004-0441005-02641
Microsoft Team Explorer for Visual Studio 2013

Visual Basic 2013 06157-004-0441005-02641
Microsoft Visual Basic 2013

Visual C# 2013 06157-004-0441005-02641
Microsoft Visual C# 2013

Visual C++ 2013 06157-004-0441005-02641
Microsoft Visual C++ 2013

Common Azure Tools 1.4
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

NuGet Package Manager 2.8.60610.756
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

Code:

BpLibraryTestPrivatePch.h

// Some copyright should be here...
#include "Engine.h"
#include "BpLibraryTest.h"

// You should place include statements to your module's private header files here.  You only need to
// add includes for headers that are used in most of your module's source files though.

BpLibraryTest.h (comments removed)

// Some copyright

#pragma once

#include "ModuleManager.h"



class FBpLibraryTestModule : public IModuleInterface
{
public:

	/** IModuleInterface implementation */
	virtual void StartupModule() override;
	virtual void ShutdownModule() override;
};

UCLASS()
class  UIceWareBPLibraryModule : public UBlueprintFunctionLibrary {
/*
File I/O to  and write data, as well as support functions, getting directory information, file information, 
erasing files, etc.
*/

	GENERATED_UCLASS_BODY()
UFUNCTION(BlueprintCallable, Category = "IceWareFileBluePrintLibrary")
static bool IceWareFileWrite_StringsToFile(FString TargetDirectory, FString FileName, FString SingleString,
		TArray<FString> StringArray, 		
		bool& AllOk, int32& ReturnCode,
		FString& RcMessage, int32& RecordsWritten, int32& ExecTime, bool OverWrite = false, 
		int32 NumberOfElementsForEachRecord = 1, FString ElementDelimiter = ",", FString NewLine = "\r");
};

Details

If the two statements of UCLASS() and GENERATED_UCLASS_BODY() are removed via commenting out. Then the plugin will compile with no errors. As is evidence here…

1>------ Build started: Project: BcBpLibraryV1_1, Configuration: Development_Editor x64 ------
1> Performing 3 actions (4 in parallel)
1> PCH.BpLibraryTestPrivatePCH.h.cpp
1> BpLibraryTest.cpp
1> [3/3] Link UE4Editor-BpLibraryTest.dll
1> Creating library G:\Epic.Submission\BcBpLibraryV1_1\Plugins\BpLibraryTest\Intermediate/Build/Win64\UE4Editor\Development\UE4Editor-BpLibraryTest.lib and object G:\Epic.Submission\BcBpLibraryV1_1\Plugins\BpLibraryTest\Intermediate/Build/Win64\UE4Editor\Development\UE4Editor-BpLibraryTest.exp
1> -------- End Detailed Actions Stats -----------------------------------------------------------
1> Total build time: 47.24 seconds
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

I really have no idea what I’m doing wrong. But something certainly has to be wrong, As I cannot see the nodes that i’m attempting to create for use in Blueprints. These errors ocurr no matter what is in the BpLibraryTest.cpp.

If the function is actually implemented, the errors occur, if the function is not there at all, the errors occur.

Hopefully someone can see what I’m doing that is so stupid.

Thank you for your time,

Hopefully the following information will help.

I kept giving the compiler, what it was asking for, in BpLibraryTest.h, which is the following

BpLibraryTest.h

int32 UCLASS() ;
class UIceWareBPLibraryModule : public UBlueprintFunctionLibrary {
/*
File I/O to and write data, as well as support functions, getting directory information, file information,
erasing files, etc.
*/

int32 GENERATED_UCLASS_BODY()

UFUNCTION(BlueprintCallable, Category = “IceWareBPLibrary|IwFileFunctions”) ;

added a “int32” preceding the UCLASS() macro, and a trailing semicolon. Did the same with GENERATED_UCLASS_BODY(), the int32, but not the semicolon.

Now the Plugin will compile, BUT, it’s not correct still. To my understanding, at this point, I should be able to right click, when in the blue print editor, and find the functions in the Blueprint list (making sure to have clicked off Context Sensative). Such is not the case, there are no functions there in a category (or any permutation there of).

Hope this helps,

Hey jayice-

How are you creating your plugin and attempting to compile it? Can you post the code for the plugin? Also, can you post the exact compile error you receive?

Hello ,

Hope your doing well today.

I am compiling using Visual Studio 2013, then right clicking in the “Solution Explorer Pane” and choosing from the popup menu, either “build” or “rebuild” makes no difference, the error is the same.

I created the plugin, by.

  1. Clicking on Edit in the UE4 editor
  2. From the drop down menu, choosing Plugins
  3. Then creating the plugin, via the new window that opens up.

After this, I copied and pasted the code, into the BpLibraryTest.h and associated BpLibraryTest.cpp file.

The actual code itself, is already in the first post. That is literally all there is. Just the “stock” .h and .cpp file. I did not alter the cpp file, as the error can be generated by just using the .h file.

The exact compilation errors are already posted, in the first post that I made, that is all the errors copied from the “output pane” of Visual Studio 2013.

Hope this helps, and thank you for your response.

I tried to follow the steps you described and did not get any compile error after adding a new plugin. These are the exact steps I took, let me know if there something I’m doing differently:

  1. Open a project

  2. Edit->Plugings

  3. In the Plugins menu clicked “New Plugin”

  4. Selected “Blank” and named it MyTestPlugin (prompted to restart the editor / reload Visual Studio)

  5. In VS I right-clicked the project name and selected build

This built the project along with the plugin and complete successfully. Are you able to reproduce the compile error in a new project? If you are please let me know what I’ve missed.

I am not for sure, how important this is, but.

BpLibraryTest.generated.h

Is not being generated, ever. Or at least the compiler cannot find it, if it is included, in BpLibraryTest.h

Here is the error output from the compiler.

Compiler Error Output

1>------ Build started: Project: BcBpLibraryV1_1, Configuration: Development_Editor x64 ------
1> Compiling game modules for hot reload
1> Performing 4 actions (4 in parallel)
1> [2/4] Link UE4Editor-BcBpLibraryV1_1-7112.dll
1> Creating library G:\Epic.Submission\BcBpLibraryV1_1\Intermediate/Build/Win64\UE4Editor\Development\UE4Editor-BcBpLibraryV1_1-7112.lib and object G:\Epic.Submission\BcBpLibraryV1_1\Intermediate/Build/Win64\UE4Editor\Development\UE4Editor-BcBpLibraryV1_1-7112.exp
1> PCH.BpLibraryTestPrivatePCH.h.cpp
1>G:\Epic.Submission\BcBpLibraryV1_1\Plugins\BpLibraryTest\Source\BpLibraryTest\Public\BpLibraryTest.h(7): fatal error C1083: Cannot open include file: ‘BpLibraryTest.generated.h’: No such file or directory
1> -------- End Detailed Actions Stats -----------------------------------------------------------
1>ERROR : UBT error : Failed to produce item: G:\Epic.Submission\BcBpLibraryV1_1\Plugins\BpLibraryTest\Binaries\Win64\UE4Editor-BpLibraryTest-5154.dll
1> Total build time: 39.13 seconds
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command ““G:\unreal4.launch\Epic Games\4.9\Engine\Build\BatchFiles\Build.bat” BcBpLibraryV1_1Editor Win64 Development “G:\Epic.Submission\BcBpLibraryV1_1\BcBpLibraryV1_1.uproject” -rocket -waitmutex” exited with code -1.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Hope this helps,

Yes the exact same results for me, no problems when it’s just the blank plugin with no alterations.

But

if we add the following to the .h file (nothing needs to be done to the cpp)

UCLASS() class UIceWareBPLibraryModule : public UBlueprintFunctionLibrary { / File I/O to and write data, as well as support functions, getting directory information, file information, erasing files, etc. /

GENERATED_UCLASS_BODY()
UFUNCTION(BlueprintCallable, Category = “IceWareFileBluePrintLibrary”) static bool IceWareFileWrite_StringsToFile(FString TargetDirectory, FString FileName, FString SingleString, TArray StringArray, bool& AllOk, int32& ReturnCode, FString& RcMessage, int32& RecordsWritten, int32& ExecTime, bool OverWrite = false, int32 NumberOfElementsForEachRecord = 1, FString ElementDelimiter = “,”, FString NewLine = “\r”); };

Then the error occurs, as shown in the first post.

I am using, a brand new plugin creation, with only the above change as noted in place.

,

One thing I neglected, is that in the *PCH.h file, I do include Engine.h.

At the start of this, it really wasn’t important, except for the base class, that I am trying to use in the declaration. Now that your trying to recreate, it is.

Also I have changed the base class. no change for me in the outcome.

,

As soon as the “system” (for lack of a better term) started generating
the include file of: “BpLibraryTest.generated.h”

everything started working better, which this was not being generated before I have no clue, nor do I have a clue as to why it started being generated, it was just MAGIC!

Except now I have the following… The linkage step is puking all over the place with the following output, and I cannot find out why it’s doing this. I have tried to put in startup and shutdown, functions, no change, using void and static classifiers for those two functions, no change, it just refuses to link on some Initializer, that I do not seem to have control of.

1>BpLibraryTest.generated.cpp.obj : error LNK2019: unresolved external symbol “public: __cdecl UIceWareBPLibraryModule::UIceWareBPLibraryModule(class FObjectInitializer const &)” (??0UIceWareBPLibraryModule@@QEAA@AEBVFObjectInitializer@@@Z) referenced in function “void __cdecl InternalConstructor(class FObjectInitializer const &)” (??$InternalConstructor@VUIceWareBPLibraryModule@@@@YAXAEBVFObjectInitializer@@@Z)
1>G:\Epic.Submission\BcBpLibraryV1_1\Plugins\BpLibraryTest\Binaries\Win64\UE4Editor-BpLibraryTest.dll : fatal error LNK1120: 1 unresolved externals
1> -------- End Detailed Actions Stats -----------------------------------------------------------
1>ERROR : UBT error : Failed to produce item: G:\Epic.Submission\BcBpLibraryV1_1\Plugins\BpLibraryTest\Binaries\Win64\UE4Editor-BpLibraryTest.dll
1> Total build time: 91.44 seconds
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command ““G:\unreal4.launch\Epic Games\4.9\Engine\Build\BatchFiles\Build.bat” BcBpLibraryV1_1Editor Win64 Development “G:\Epic.Submission\BcBpLibraryV1_1\BcBpLibraryV1_1.uproject” -rocket -waitmutex” exited with code -1.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Again Thank you,

For anyone searching for a solution and running into this problem in 2021 and onwards: You can’t name your Plugin the same as the project because of name collisions.

3 Likes