The most common cause of this is that you have not included the path to the modules directory see here.
This may not be your issue but I would double check that you are including the path to the modules directory and not another directory inside opencv contrib.