Is "not having friends" because of giftedness, though?
There is a whole spectrum of introversion/ extraversion and IME it doesn't particularly overlap with giftedness.
Of the definitely gifted kids (and adults) that I know, most are sociable and well integrated. The ones who aren't, are generally introverts, or have some issues with social skills and situations that may or may not be severe enough to qualify them as being on the autistic spectrum.
My own moderately gifted DS is quite introverted, uncomfortable in large groups (better in small ones) and has some autistic traits although he is plainly not autistic. It has taken many years for him to start to feel comfortable in social situations at school - really it's just this year (Y9 equiv., he'll be 13 on Sunday) that he has developed reasonably normal school friendships. He has one very close friendship outside school, and is friendly on a more superficial level with the kids from his cycling club.
Contrast this DD who is much more gifted but very able in social situations (except when annoyed, when she sometimes doesn't know when to shut up). She has been fortunate through secondary school to have at least 2 other obviously gifted kids in each of her classes, but in only one case has she developed a close friendship with that child. She tends to make friends with "high EQ" girls, and more generally (on summer camps) with the more original and slightly offbeat teens (this is NOT code for "gifted").
Mind you the more I read this thread the more I wonder if her IQ test wasn't moumentally wrong, since she has very in little in common with the gifted stereotype. She's not even especially good at maths ;)