[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
- [Lzip-bug] mingw build failure,
Roy <=
- Re: [Lzip-bug] mingw build failure, Antonio Diaz Diaz, 2013/01/10
- Re: [Lzip-bug] mingw build failure, Roy Tam, 2013/01/10
- Re: [Lzip-bug] mingw build failure, Antonio Diaz Diaz, 2013/01/11
- Re: [Lzip-bug] mingw build failure, Roy Tam, 2013/01/11
- Re: [Lzip-bug] mingw build failure, Antonio Diaz Diaz, 2013/01/12
- Re: [Lzip-bug] mingw build failure, Roy Tam, 2013/01/12
- Re: [Lzip-bug] mingw build failure, JonY, 2013/01/12
- Re: [Lzip-bug] mingw build failure, Antonio Diaz Diaz, 2013/01/13
- Re: [Lzip-bug] mingw build failure, JonY, 2013/01/14
- Re: [Lzip-bug] mingw build failure, Antonio Diaz Diaz, 2013/01/14