Trying to include <dirent.h> into my cmake build

Hello everyone,

I’m very new to using cmake and installed it so that I could use the opencv2 library. However, I need to be able to use the <dirent.h> header file which is being pulled from my system path at “C:\msys64\mingw64\include\dirent.h”. I would like to add this library to my build but don’t know how to do so. I have #include <dirent.h> on my cpp flile but don’t know what else I should do. Here is my cmake.txt

It looks like Visual Studio is being used so you’d want their dirent.h. I haven’t seen this problem. Maybe you need to have msys2 gcc.exe on Path. That how I use msys2 gcc from Windows Terminal or Command Prompt.

What compiler are you wanting? GCC or CL?