i have a basic hello world plugin, that now compiles, links, but then fails at runtime with the error below.
/home/raptor/UnrealEngine/Engine/Binaries/Linux/UE4Editor: symbol lookup error: /home/raptor/Documents/Unreal Projects/MyProject/Plugins/MyPlugin/Binaries/Linux/libUE4Editor-MyPlugin.so: undefined symbol: _ZN22UMyCustomMeshComponentC1ERK18FObjectInitializer
My hello world is just a skeleton, and i haven’t defined a constructor for my UCLASS yet. I was expecting a compile time, or link time error, not a runtime error like this one.
my .cpp file
#pragma once
#include <ModuleManager.h>
#include <IMyPlugin.h>
std::vector<std::shared_ptr<std::thread>> __spawned_threads__;
class FMyPlugin : public IMyPlugin {
virtual void StartupModule() override {
std::cout << std::string("TESTING MYBLUEPRINT...") << std::endl;
}
virtual void ShutdownModule() override {
std::cout << std::string("MYPLUGIN EXIT") << std::endl;
}
};
IMPLEMENT_MODULE( FMyPlugin, MyPlugin )
my header file
#pragma once
#include <Eigen/Core>
#include <random>
#include <memory>
#include <vector>
#include <array>
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <map>
#include <set>
#include <algorithm>
#include <functional>
#include <thread>
#include <chrono>
#include <cmath>
#include <complex>
#include <atomic>
#include <cstdlib>
typedef long i64;
typedef int i32;
typedef double f64;
typedef double float64;
typedef float f32;
typedef float float32;
typedef const char* cstring;
typedef std::string string;
#include "Runtime/UMG/Public/UMG.h"
#include "Runtime/UMG/Public/UMGStyle.h"
#include "Runtime/UMG/Public/Slate/SObjectWidget.h"
#include "Runtime/UMG/Public/IUMGModule.h"
#include "Runtime/UMG/Public/Blueprint/UserWidget.h"
#include "AIController.h"
#include "Components/AudioComponent.h"
#include "AudioDecompress.h"
#include "AudioDevice.h"
#include "ActiveSound.h"
#include "Audio.h"
#include "Developer/TargetPlatform/Public/Interfaces/IAudioFormat.h"
#include "VorbisAudioInfo.h"
#include "IMyPlugin.generated.h"
class IMyPlugin : public IModuleInterface {
IMyPlugin& Get() {
return FModuleManager::LoadModuleChecked<IMyPlugin>("MyPlugin");
}
bool IsAvailable() {
return FModuleManager::Get().IsModuleLoaded("MyPlugin");
}
};
USTRUCT(BlueprintType)
struct FMyCustomMeshTriangle {
GENERATED_USTRUCT_BODY()
UPROPERTY(EditAnywhere, Category=Triangle)
FVector Vertex0;
UPROPERTY(EditAnywhere, Category=Triangle)
FVector Vertex1;
UPROPERTY(EditAnywhere, Category=Triangle)
FVector Vertex2;
};
UCLASS()
class UMyCustomMeshComponent: public UMeshComponent {
GENERATED_UCLASS_BODY()
public:
TArray<FMyCustomMeshTriangle> CustomMeshTris;
std::weak_ptr<UMyCustomMeshComponent> __weakref__;
bool __initialized_UMyCustomMeshComponent;
constexpr static const char* __class__ = "UMyCustomMeshComponent";
virtual std::string get_class_name(){ return std::string("UMyCustomMeshComponent");}
};