lzip-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Lzip-bug] mingw: undefined reference to `_fsetmode'


From: Roy
Subject: [Lzip-bug] mingw: undefined reference to `_fsetmode'
Date: Thu, 10 Jan 2013 12:04:27 +0800
User-agent: Opera Mail/11.64 (Win32)

Hi all,

There is no _fsetmode in mingw environment.

main.c:777:3: warning: implicit declaration of function '_fsetmode' [-Wimplicit-function-declaration]
gcc  -o clzip carg_parser.o encoder.o decoder.o main.o
main.o:main.c:(.text.startup+0x1f7): undefined reference to `_fsetmode'
main.o:main.c:(.text.startup+0x20f): undefined reference to `_fsetmode'
d:/msys/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.1/../../../../i686-w64-mingw32/bin/ld.exe: main.o: bad reloc address 0x20f in section `.text.startup' d:/msys/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.1/../../../../i686-w64-mingw32/bin/ld.exe: final link failed: Invalid operation
collect2.exe: error: ld returned 1 exit status
make: *** [clzip] Error 1


Instead, the old method, setmode(), works.

#if defined(__MSVCRT__)
  setmode(STDIN_FILENO, O_BINARY);
  setmode(STDOUT_FILENO, O_BINARY);
#endif

HTH,
Roy




reply via email to

[Prev in Thread] Current Thread [Next in Thread]