Thanks for the quick answer. It seems there are some things I should explain.
Why not just attach it to the Mesh of the character and then set it to the socket name? No idea whether this would actually work but I don’t see why not as RootComponent is actually allowed so Mesh should be as well as long as you define the mesh within C++.
RootComponent is allowed, because it inherits from USceneComponent. USkeletalMeshComponent does not. So allthough my mesh has been defined (as I stated, my class inherits from ACharacter), it is not possible to use it with the “USceneComponent::SetupAttachment”-function, as this function requires USceneComponent-pointers as arguments.
This was my initial question. Are there any alternative functions I can use?