My best guess is that the copy of jpeglib.h bundled with gd is out of step with the jpeglib.h from libjpeg.
Yes, I think so. I suspect that gd-2.0.35 might want something later than jpeg-6b (which is about 13 years old). So I might first try upgrading jpeg rather than downgrading gd.
I'll post again when I get it sorted ... might take a while.