Yes, I recommend that you use the exact same compiler and library versions as your instructor.
It is surprisingly easy to write C++ code that works differently (or not at all) between systems and library versions. These problems are often artifacts of historical baggage, but sometimes they result from incorrect assumptions that are made in involved code.
You don't want to fight with unfamiliar portability issues while taking a test. Use the same tools as your instructor.
However, you don't need to completely ignore other tool-chains. In fact, using multiple compilers or multiple systems (especially with the warnings turned all the way up) is a great way to verify assumptions and troubleshoot problems.
For instance, when faced with an incomprehensible compiler error message, the first thing I do is use a different compiler. Very often, one of them will point straight to the issue. A big part of being an effective programmer is using all the tools available to you. Do this and you'll be informed of a good portion of the issues with your programs.
In this thread, the original post was a copypaste from reddit or some other forum, and was about linux. You can see on the edit time that the post was edited a month later, and unrelated text about a broken camera was added to it!
If you search the text, you'll find this forum post: https: //www.canonrumors.com/forum/index.php ? threads/powershot-g3x-possible-lens-issue.37393/
THAT post was also edited with a link after the original posting (you can tell because the quoted reply doesn't have the link in it).
So yeah, this thing of pasting some bullshit and then adding a link to it apparently affects other less-moderated forums as well.