Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
366 views
in Technique[技术] by (71.8m points)

c++ - Static compilation of Qt 5 fails under mingw with reference to off64_t

I tried to make static qt, and got error during mingw-make. This is text of error.

staticqhttpnetworkreply.o accessqhttpnetworkreply.cpp
In file included from ....mkspecswin32-g++/qplatformdefs.h:56:0,
             from accessqhttpnetworkreply_p.h:55,
             from accessqhttpnetworkreply.cpp:42:
c:mingwincludeio.h:301:14: error: 'off64_t' does not name a type
__CRT_INLINE off64_t lseek64 (int, off64_t, int);
           ^
c:mingwincludeio.h:302:14: error: 'off64_t' does not name a type
__CRT_INLINE off64_t lseek64 (int fd, off64_t offset, int whence) {
          ^
Makefile.Debug:8214: recipe for target '.obj/debug_static/qhttpnetworkreply.o' f   ailed
mingw32-make[3]: *** [.obj/debug_static/qhttpnetworkreply.o] Error 1
mingw32-make[3]: Leaving directory 'C:/Qt/Qt5.1.1/5.1.1/Src/qtbase/src/network'
Makefile:38: recipe for target 'debug-all' failed
mingw32-make[2]: *** [debug-all] Error 2
mingw32-make[2]: Leaving directory 'C:/Qt/Qt5.1.1/5.1.1/Src/qtbase/src/network'
Makefile:182: recipe for target 'sub-network-make_first' failed
mingw32-make[1]: *** [sub-network-make_first] Error 2
mingw32-make[1]: Leaving directory 'C:/Qt/Qt5.1.1/5.1.1/Src/qtbase/src'
Makefile:41: recipe for target 'sub-src-make_first' failed
mingw32-make: *** [sub-src-make_first] Error 2
C:QtQt5.1.15.1.1Srcqtbase>

I use windows 8.1. I follow steps from one instructions.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

it is some bug in MinGW, when one of -ansi, -std=c++11, -std=c++03 and -std=c++98 are used. in file {MinGW dir}/include/io.h replace

__CRT_INLINE off64_t lseek64 (int, off64_t, int);
__CRT_INLINE off64_t lseek64 (int fd, off64_t offset, int whence) {

with

__CRT_INLINE _off64_t lseek64 (int, _off64_t, int);
__CRT_INLINE _off64_t lseek64 (int fd, _off64_t offset, int whence) {

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...