Subclassing BoxComponent

I’m trying to create a subclass of BoxComponent, but I’m running into a Catch-22.

After I create the class via the editor and try and compile, I get a load of unresolved external symbol errors. According to this post, those can be solved by adding ENGINE_API in the class definition.

That does work, and gets rid of all the unresolved external symbol errors, but when I compile it again, I now get an inconsistent dll linkage warning, which is treated as an error. According to this, that can be removed by adding MODULENAME_API in the same place I added ENGINE_API before, but this just reintroduces all the errors I had to begin with.

So, how can I actually compile a class that inherits from BoxComponent? Neither of these solutions alone works.

Thanks.

First thing I would try is to do a full rebuild. My suspicion is the inconsistent dll linkage is that some of your modules have linked to the dll with the BoxComponent exposed, but that you still have some modules linking against the previous API.

Full rebuild didn’t work

Did you also remove the MinimalAPI from the UCLASS macro when you added ENGINE_API?

The UCLASS macro is empty. This is with a completely clean class that had just been created. In an earlier attempt though, I removed the MinimalAPI, but it didn’t help.

Does anyone Solved this ?

Hey -

You should be able to use the “New C++ Class” wizard to create a class based on UBoxComponent. If you’re running into issues with this, please provide more information about what you’re doing.