Did you include “vex.h” and “gifclass.h” at the beginning of your program?
See attached example in this topic: Animated GIF Demo (VEXcode)
vex::Gif class is not a part of the default VEXcode API: VEX Help
PNG and BMP images can be drawn with drawImageFromFile(): VEX Help
See example here: Drawing Image on V5 Screen - #3 by trontech569