How do I connect physical meshes with sockets?

Hey, recently I have been having a problem with ue4 and sockets. After debugging I figured out it has something to do with the path. (Meaning it can’t find the asset). I was wondering if anyone could help.

(code)

PlayerInputComponent->BindAction(“Weapon1”, IE_Released, this, &AStealthGameCharacter::OnSwitchWeapon1);
//some lines later

UClass *m_cUClassWeapon = StaticLoadClass(UObject::StaticClass(), nullptr, TEXT(“knifeinprogressbetter”));

if (!m_cUClassWeapon) {
	GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Yellow, TEXT("Can't find asset!"));

}

else {
	AActor *m_cWeapon = GetWorld()->SpawnActor<AActor>(m_cUClassWeapon);
	m_cWeapon->AttachRootComponentTo(GetMesh(), PlayerWeaponSocketName, EAttachLocation::SnapToTarget, true);
}

}
If anyone could figure this out I would appreciate it greatly!
Thanks