Use opencv_traincascade

I want to train a haar cascade classifier. I need to use a command with opencv_traincascade. It doesn’t work with a recent version of open cv. There are posts where they say I need to switch to an older version. Which I did. I switched to the 3.4 version (I did a git clone of open cv and then git checkout 3.4). Then I tried to build opencv with cmake (I followed this doc). But I got errors. In the CMakeError file it says ucrtd.lib can’t be opened.