Which version of opencv has ability to read GIF file?

maybe you need to specify the CAP_FFMPEG explicitly

( or maybe, you dont have support fo that in c++ ? check cv::getBuildInformation(); )