Hello,
I am trying to create a plugin with a UObject derived class in it just like the UObjectPlugin example which is including in the engine/plugin folder. I am however facing a problem which I just cannot solve.
I am using engine version 4.9.2. When I try to build I get the following error:
Error 1 error : Source file “C:…\PluginTest\Plugins\SomePlugin\Source\SomePlugin\Private\TestObject.cpp” is not including any headers. We expect all modules to include a header file for precompiled header generation. Please add an #include statement. C:…\PluginTest\Intermediate\ProjectFiles\EXEC PluginTest
I tried adding the UObjectPlugin example to my project instead of the engine/plugin folder and it compiles just fine so I tried changing my own plugin to be completely identical to the UObjectPlugin example with the exception of some of the names. All files are the same/uses same includes. Header files are placed identically as well however it is all to no avail. I cannot compile my own plugin.
The class I am trying to compile:
header
#pragma once
#include "TestObject.generated.h"
UCLASS()
class UTestObject : public UObject
{
GENERATED_BODY()
};
source
#include "SomePluginPrivatePCH.h"
#include "TestObject.h"
Module:
header
#pragma once
#include "ModuleManager.h"
class FSomePlugin : public IModuleInterface
{
public:
/** IModuleInterface implementation */
virtual void StartupModule() override;
virtual void ShutdownModule() override;
};
source
#include "SomePluginPrivatePCH.h"
void FSomePlugin::StartupModule()
{
// This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module
}
void FSomePlugin::ShutdownModule()
{
// This function may be called during shutdown to clean up your module. For modules that support dynamic reloading,
// we call this function before unloading the module.
}
IMPLEMENT_MODULE(FSomePlugin, SomePlugin)
Any help would be appreciated.