Well then I would guess at a coding error, car to post the piece of coding exhibiting the error.
the whole code is as of below.
#include <sys/types.h>
#include <cstdlib>
#include <stdio.h>
#include <dirent.h>
#include <dir.h>
#include <errno.h>
#include <vector>
#include <string>
#include <iostream>
#include <fstream>
using namespace std;
/*function... might want it in some class?*/
int getdir (string dir, vector<string> &files)
{
DIR *dp;
struct dirent *dirp;
if((dp = opendir(dir.c_str())) == NULL) {
cout << "Error(" << errno << ") opening " << dir << endl;
return errno;
}
while ((dirp = readdir(dp)) != NULL) {
files.push_back(string(dirp->d_name));
}
closedir(dp);
return 0;
}
int main()
{
string dir = string(".");
vector<string> files = vector<string>();
getdir(dir,files);
for (unsigned int i = 0;i < files.size();i++) {
cout << files[i] << endl;
}
return 0;
}
the error msg is as of:
Error 1 fatal error C1083: Cannot open include file: 'dirent.h': No such file or directory