Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qt doesn't compile #1103

Closed
puchu opened this issue Dec 26, 2015 · 10 comments
Closed

qt doesn't compile #1103

puchu opened this issue Dec 26, 2015 · 10 comments

Comments

@puchu
Copy link

puchu commented Dec 26, 2015

I tried to build qt with
"make qt"

but i get:

i686-w64-mingw32.static-gcc -c -include .obj/release-static/qt_pch.h -pipe -fno-keep-inline-dllexport -O2 -Wall -Wextra -DQT_THREAD_SUPPORT -DUNICODE -DQ_USE_SYBASE -DQT_BUILD_CORE_LIB -DQT_NO_USING_NAMESPACE -DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -D_USE_MATH_DEFINES -DQLIBRARYINFO_EPOCROOT -DHB_EXPORT=Q_CORE_EXPORT -DQT_NO_DEBUG -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_HAVE_SSE3 -DQT_HAVE_SSSE3 -DQT_HAVE_SSE4_1 -DQT_HAVE_SSE4_2 -DQT_HAVE_AVX -I'../../include' -I'../../include/QtCore' -I'.rcc/release-static' -I'tmp' -I'global' -I'../../tools/shared' -I'../3rdparty/harfbuzz/src' -I'../3rdparty/md5' -I'../3rdparty/md4' -I'../../include/ActiveQt' -I'.moc/release-static' -I'../../mkspecs/win32-g++-4.6' -o .obj/release-static/harfbuzz-gdef.o ../3rdparty/harfbuzz/src/harfbuzz-gdef.c
cc1: error: one or more PCH files were found, but they were invalid
cc1: error: use -Winvalid-pch for more information
cc1: fatal error: .obj/release-static/qt_pch.h: No such file or directory
compilation terminated.
Makefile.Release:13835: recipe for target '.obj/release-static/harfbuzz-buffer.o' failed
make[4]: *** [.obj/release-static/harfbuzz-buffer.o] Error 1
make[4]: *** Waiting for unfinished jobs....
cc1: error: one or more PCH files were found, but they were invalid
cc1: error: use -Winvalid-pch for more information
cc1: fatal error: .obj/release-static/qt_pch.h: No such file or directory
compilation terminated.
Makefile.Release:13852: recipe for target '.obj/release-static/harfbuzz-gdef.o' failed
make[4]: *** [.obj/release-static/harfbuzz-gdef.o] Error 1
make[4]: Leaving directory '/mnt/data/Develop/Progs/windows/mxe/tmp-qt-i686-w64-mingw32.static/qt-everywhere-opensource-src-4.8.7/src/corelib'
Makefile:34: recipe for target 'release' failed
make[3]: *** [release] Error 2
make[3]: Leaving directory '/mnt/data/Develop/Progs/windows/mxe/tmp-qt-i686-w64-mingw32.static/qt-everywhere-opensource-src-4.8.7/src/corelib'
Makefile:241: recipe for target 'sub-corelib-make_default-ordered' failed
make[2]: *** [sub-corelib-make_default-ordered] Error 2
make[2]: Leaving directory '/mnt/data/Develop/Progs/windows/mxe/tmp-qt-i686-w64-mingw32.static/qt-everywhere-opensource-src-4.8.7'
Makefile:518: recipe for target 'build-only-qt_i686-w64-mingw32.static' failed
make[1]: *** [build-only-qt_i686-w64-mingw32.static] Error 2
make[1]: Leaving directory '/mnt/data/Develop/Progs/windows/mxe'

how can i fix this?

@starius
Copy link
Member

starius commented Dec 26, 2015

Can you upload full log file to gist, please?

PCH means pre-compiled header.

@puchu
Copy link
Author

puchu commented Dec 27, 2015

@tonytheodore
Copy link
Member

Are you using some sort of "hardened" kernel (with address randomisation)?

@puchu
Copy link
Author

puchu commented Dec 27, 2015

yes + hardened userland

@tonytheodore
Copy link
Member

I think you'll have to build gcc with LDFLAGS='-Wl,-no_pie'. If that works, do you know a command that can detect if hardening is enabled?

@puchu
Copy link
Author

puchu commented Dec 27, 2015

you can use "gcc -v" to see how gcc was build

I compiled it inside a vm and there it worked.

but now i get

./../build-release/Json.o:Json.cpp:(.text+0xe33): undefined reference to `_imp___ZN5QJson6ParserD1Ev'

altough i build it with

make qjson

any idea how to fix this?

i currently use this in my "pro" file for qmake

LIBS += -lqjson -lcrypto -static

@tonytheodore
Copy link
Member

you can use "gcc -v" to see how gcc was build

It's not so much how gcc was built, but the running system options. Something along the lines of sestatus or getenforce?

/mnt/data/mxe/usr/bin/i686-w64-mingw32.static-ld: cannot find -lQtCored

The *d suffix is for debug builds, we only build the release libs.

how i tell qmake to to link statically?

How are you invoking qmake? It should determine the linking options automatically.

@puchu
Copy link
Author

puchu commented Dec 27, 2015

i was on debug, that's correct, but now i get:

./../build-release/Json.o:Json.cpp:(.text+0xe33): undefined reference to `_imp___ZN5QJson6ParserD1Ev'

although i build qjson inside mxe with

make qjson

any idea how to fix this?

i currently use this in my "pro" file for qmake

LIBS += -lqjson -lcrypto -static

i call qmake with

export PATH=/<mxe>/usr/bin:$PATH
i686-w64-mingw32.static-qmake-qt4 .

sorry for changing the post above

@tonytheodore
Copy link
Member

./../build-release/Json.o:Json.cpp:(.text+0xe33): undefined reference to `_imp___ZN5QJson6ParserD1Ev'

You probably need to add -DQJSON_STATIC to CFLAGS

i currently use this in my "pro" file for qmake

LIBS += -lqjson -lcrypto -static

Don't add -static here, it isn't a lib. qmake will set the appropriate CONFIG entry for static builds.

starius added a commit to LuaAndC/mxe that referenced this issue Oct 27, 2016
Qt and qtbase fail to build if host compiler is GCC 6
with the following error message:

cc1: error: one or more PCH files were found, but they were invalid
cc1: error: use -Winvalid-pch for more information
cc1: fatal error: .obj/release-shared/qt_pch.h: No such file or directory

See mxe#1554
See mxe#1103
See mxe#1527 (comment)
starius added a commit to LuaAndC/mxe that referenced this issue Oct 27, 2016
Qt and qtbase fail to build if host compiler is GCC 6
with the following error message:

cc1: error: one or more PCH files were found, but they were invalid
cc1: error: use -Winvalid-pch for more information
cc1: fatal error: .obj/release-shared/qt_pch.h: No such file or directory

See mxe#1554
See mxe#1103
See mxe#1527 (comment)
starius added a commit to LuaAndC/mxe that referenced this issue Oct 28, 2016
Qt and qtbase fail to build if host compiler is GCC 6
with the following error message:

cc1: error: one or more PCH files were found, but they were invalid
cc1: error: use -Winvalid-pch for more information
cc1: fatal error: .obj/release-shared/qt_pch.h: No such file or directory

See mxe#1554
See mxe#1103
See mxe#1527 (comment)
@starius
Copy link
Member

starius commented Oct 28, 2016

Fixed in #1557

@starius starius closed this as completed Oct 28, 2016
tehnick pushed a commit to sibuserv/mxe that referenced this issue Nov 28, 2016
Qt and qtbase fail to build if host compiler is GCC 6
with the following error message:

cc1: error: one or more PCH files were found, but they were invalid
cc1: error: use -Winvalid-pch for more information
cc1: fatal error: .obj/release-shared/qt_pch.h: No such file or directory

See mxe#1554
See mxe#1103
See mxe#1527 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants