Broken header dirent.h

Corinna Vinschen corinna-cygwin@cygwin.com
Mon Jul 14 08:49:00 GMT 2014


Hi Ryan,

On Jul 12 13:53, Ryan Johnson wrote:
> Hi all,
> 
> Please CC me in replies, I'm no longer a list member.

Given the massive amount of mail on this list I can see your point... ;)

> I recently tried to use <sys/dirent.h> in a C++ program and got linker
> errors. Turns out the header is neither C++-aware (extern "C") nor
> cygwin-aware (_EXFUN).

It doesn't have to be.  Including <sys/dirent.h> is not meant to be done
in application code.  The POSIX header is <dirent.h>, not <sys/dirent.h>:
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/dirent.h.html

If you include <dirent.h>, your linker problems should go away.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-developers/attachments/20140714/307c55bf/attachment.sig>


More information about the Cygwin-developers mailing list