I don't know the particlulars of your error but I have finally got gd running doing the following:
First build gd as explained by Scott Anguish at Stepwise:
http://www.stepwise.com/Articles/Workbench/2001-06-12.01.html
Next you need to build PHP, here is what I did
mkdir...