dllexport (was dllimport and initialization issue)

Kai Tietz ktietz70 at googlemail.com
Thu Jul 22 19:48:33 UTC 2010


Michael,

2010/7/22 Michael Cronenworth <mike at cchtml.com>:
> The code compiles fine, but I still get an annoying warning, which does
> not make sense to me. Is it resolvable?

The annoying warnings comes by the fact that _fmode is declared in
headers to be dllimport'ed. And then you define it.
Simplest way to solve this is to use a separate file including just
fcntl.h and then have the line 'int _fmode = _O_BINARY;'

> I am attempting to set O_BINARY as default so read() calls will give me
> real data instead of translated garbage.

Ok, you can change buffer mode of stdin/stdout/stderr file handles
also in main, too. For streams via setvbuf and for I/O handles via
_setmode C-runtime functions.

Kai


-- 
|  (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination


More information about the mingw mailing list