I try to cross-compile the PCL for QNX. I get the following error(s) in the common module when doing this:
<pcldir>/common/include/pcl/common/impl/file_io.hpp:55:17: error: 'struct dirent' has no member named 'd_type'
if (dirp->d_type == DT_REG) // Only regular files
and
<pcldir>/common/include/pcl/common/impl/file_io.hpp:55:27: error: 'DT_REG' was not declared in this scope
if (dirp->d_type == DT_REG) // Only regular files
There should be no compile errors ;-) ... Or at least it would be nice to go for a standard POSIX way of regular file checking.
The problem occurs in the getAllPcdFilesInDirectory function which uses d_type extension for struct dirent from glibc, which is not provided on my target system.
The whole QNX toolchain needs to be set up for this to reproduce. Indeed the problem can be reproduced with any other compiler/toolchain which does not provide the non-glibc version of struct dirent with the d_type / DT_REG definition.
I suggest to fix this by providing a fallback for systems without glibc (i.e. by checking for _DIRENT_HAVE_D_TYPE and using pure POSIX's S_ISREG() macro instead).
Ough, this function looks horrible. We should use boost::filesystem instead.
any hints about how to start in this issue ?
Can be closed I guess, since this bug should have been resolved with #3676
Fixed by #3676
Most helpful comment
Ough, this function looks horrible. We should use
boost::filesysteminstead.