lzip-bug
[Top][All Lists]
Advanced

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

[Lzip-bug] mingw build failure


From: Roy
Subject: [Lzip-bug] mingw build failure
Date: Thu, 10 Jan 2013 12:34:29 +0800
User-agent: Opera Mail/11.64 (Win32)

Hi all,

There is no _fsetmode() in mingw environment.

main.c: In function 'main':
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(__OS2__)
  _fsetmode( stdin, "b" );
  _fsetmode( stdout, "b" );
#endif
#if defined(__MSVCRT__)
  setmode(STDIN_FILENO, O_BINARY);
  setmode(STDOUT_FILENO, O_BINARY);
#endif

BTW it will be nice to #define strtoll as _strtoi64, as older w32api versions will not have this defined.

#define strtoll _strtoi64

for clzip, does unistd.h is really needed? In TinyCC win32 environment, it doesn't have it. I commented they out and it builds with tcc(although the result binary is slow).

HTH,
Roy




reply via email to

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