There appear to be a few different classes of error:
main.cpp:8:19: error: conio.h: No such file or directory
main.cpp:61: error: ‘_kbhit’ was not declared in this scope
conio.h
is Window's console io header. _kbhit is one of the functions in it.
main.cpp:17: warning: deprecated conversion from string constant to ‘char*’
A string constant is of type const char *
in ANSI C++. There are also quite a few odd string functions in the code which wouldn't exist if you were using C++ std::string rather than C strings using new.
vbinary.cpp:5:16: error: io.h: No such file or directory
vdirectory.cpp:91: error: ‘_findfirst’ was not declared in this scope
vdirectory.cpp:99: error: ‘_findnext’ was not declared in this scope
vdirectory.cpp:101: error: ‘_findclose’ was not declared in this scope
vfile.cpp:19: error: ‘_MAX_DRIVE’ was not declared in this scope
vfile.cpp:20: error: ‘_MAX_DIR’ was not declared in this scope
vfile.cpp:21: error: ‘_MAX_FNAME’ was not declared in this scope
vfile.cpp:22: error: ‘_MAX_EXT’ was not declared in this scope
io.h
is another Microsoft header, with the functions for navigating directories and the macros used with them. Use the functions in dirent.h
instead. Functions such as VDirectory::CreatePath
assume that there are separate drive letters; unix file systems don't, so it's probably better to have completely separate classes for the implementations rather than trying to put two separate bodies into each function using #ifdef
s, and use one #ifdef to select the appropriate one in your main.
Constants such as _MAX_FNAME
are in both io.h and Microsoft's stdlib.h. They aren't in the standard stdlib.h
, nor are the functions whose input size they limit. The POSIX versions use NAME_MAX
.