I’d like to make use of the code in UCustomMeshComponent, i’ve been following articles I’ve found online on how to get this building but I’m now seeing link errors.
The solution proposed by the articles below is the duplicate this code into a code file within my project, is there no way I could just get the code within the plugin to work without having to duplicate?
I research a little more about this question. I thought that UCustomMeshComponent is a part of engine,but it is part of CustomMeshPlugin. You should try CUSTOMMESHCOMPONENT_API instead of ENGINE_API.
class CUSTOMMESHCOMPONENT_API UCustomMeshComponent : public UMeshComponent
This seems to compile! I will run some further tests but perhaps this is worth submitting and updating the Wiki article? Since it would be best not to duplicate and have another dependency to update.
We have added some information about how to solve link issue. If you see that problem not described in full size or you have some more information about your experience with UCustomMeshCompoent, please feel free to make any edits or additions to the wiki as you wish (you log in with the same credentials as the AnswerHub).
Hi. I have the same problem and I’ve seen your addition to the wiki page but I didn’t got it. Where I have to put that code? It is not very clear to me. Any advice?
I have added CUSTOMMESHCOMPONENT_API to the CustomMeshComponent.h but still no luck. Do I need to do a full recompile of the engine itself afterwards or should it just work when I run my project?
Hi Scykopath, I was having the same issue however doing a compile on the engine seems to have fixed it. It wont recompile everything, just the changed source ie CustomMeshComponent
I’m late to the party but found a solution without copy/pasta or manually modifying my build file.
In the Unreal editor add a new C++ class and have it inherit from CustomMeshComponent. That will add your new class to the Visual Studio solution. You can now ignore/delete that class if you want, since adding it has properly included the CustomMeshComponent files into your external dependencies. Now you can include CustomMeshComponent.h to any class you want without errors about not finding/linking the files.
I successed to use UCustomMeshComponent in my project. It’s simple. Add “CustomMeshComponent” in to PublicDependencyModuleNames in Project.Build.cs. that’s all.