Stub generation with type-safe linking.