last day (15 days later) » 

6:19 PM
1
A: Qt Installation not working

user4419802 If qmake is not found, then PATH is incorrect. Regarding include's, the easiest way is to create qt.conf file. See http://doc.qt.io/qt-5/qt-conf.html P.S. Sample qt.conf [Paths] Prefix=.. Headers=include/qt5

 
1. I try to explain it better: I've installed Qt 5.4 in "C:\Qt\Qt5.4.0MinGw", so, I've edited the PATH as "C:\Qt\Qt5.4.0MinGw\5.4\mingw491_32\bin" ... 2 Where should I put a qt.conf file? and moreover, what should I write in it? thanks!
 
@Foga But where's qmake.exe? Could you just find it on the drive?
@Foga qt.conf should contain at least [Paths] and Prefix=<dir> lines as in docs. 'Prefix' is Qt's root directory, probably "C:\Qt\Qt5.4.0MinGw".
 
I've carried out an extensive search for "qmake.exe", and I found 2 "qmake.exe" (this is because I've installed 2 packages of qt) and one of them is inside the path mentioned before..
 
qmake itself is only dependent upon C runtime, but not Qt libraries. If both qmake.exe and mingw runtime dll's (such as libstdc++) are on PATH, it must work.
 
@ user4419802 I tried to type in cmd "qmake -project" -> ok; "qmake hello" -> ok, but when I try "make" -> make is not recognized as a internal command; so I tried "mingw32-make" -> fatal error: QtWidgets: No such file or directory #include <QtWidgets>
 
6:19 PM
@Foga So qmake is OK. Then create qt.conf in the directory where qmake is.
 
Should it work like "[Paths] Prefix = C:\Qt\Qt5.4.0MinGw\5.4\mingw491_32\lib" ??
 
Prefix is Qt root directory, such as C:\Qt\Qt5.4.0MinGw\5.4 Thus, libraries should become like %Prefix%\lib, headers - %Prefix%\include etc. Read doc.qt.io/qt-5/qt-conf.html
 
Thanks for the support !
...
I've edited the qt.conf as:
[Paths]

Prefix=C:/Qt/Qt5.4.0MinGw/5.4/mingw491_32
Examples=C:/Qt/Qt5.4.0MinGw/Examples/Qt-5.4
Documentation=C:/Qt/Qt5.4.0MinGw/Docs/Qt-5.4
Headers=C:/Qt/Qt5.4.0MinGw/5.4/mingw491_32/include
Libraries=C:/Qt/Qt5.4.0MinGw/5.4/mingw491_32/lib
Binaries=C:/Qt/Qt5.4.0MinGw/5.4/mingw491_32/bin
Plugins=C:/Qt/Qt5.4.0MinGw/5.4/mingw491_32/plugins
Imports=C:/Qt/Qt5.4.0MinGw/5.4/mingw491_32/imports
Qml2Imports=C:/Qt/Qt5.4.0MinGw/5.4/mingw491_32/qml
Translations=C:/Qt/Qt5.4.0MinGw/5.4/mingw491_32/translations
because as you've pointed out Prefix should be the path to the Qt main folder .. yet it still gives me the same error
"hello.cpp:1:21: fatal error: QtWidgets: No such file or directory
#include <QtWidgets>"
 
6:37 PM
There's no need to re-define all paths. For example, Libraries defaults to %Prefix%\lib anyway.
 
ok, I've also tried to remove the prefix from all paths (except the first), leavin only /lib, for example, but it still gives me the same error ;(
 
You should check how "Headers" sub-directory looks like. It must contain the following subdirectories: QtCore, QtGui, QtWidgets etc. If not, probably, you should change it to include\qt5 or something like that.
Qt complains to "Headers". Just now only "Prefix" and "Headers" are relevant.
 
It indeed contains QtWidgets!
 
And still the same error?
 
yes! so unlucky!
 
6:46 PM
Where is qt.conf is? It should be in the same directory as qmake.exe
 
yes! it's there!
I've also tried to write #include<sthelse> (sthelse is in include folder) and the same error..
 
Clean project directory. Leave only sources, re-generate .pro file using "qmake -project" command
 
sources are like .cpp files?
 
Yes, leave only *.cpp and *.h if any
The test project is in the separate directory, I hope?
 
neither that way..
sorry? separate directory? what do you mean?
 
6:54 PM
Show what's your project file, please
Add to your .pro the line QT+=widgets
 
######################################################################
# Automatically generated by qmake (3.0) Sat Feb 21 19:51:47 2015
######################################################################

TEMPLATE = app
TARGET = hello
INCLUDEPATH += .

# Input
SOURCES += main.cpp
 
QT += widgets
 
like that ?
 
And both "qmake" and "make release" one more time
 
######################################################################
# Automatically generated by qmake (3.0) Sat Feb 21 19:51:47 2015
######################################################################

TEMPLATE = app
TARGET = hello
INCLUDEPATH += .
QT+=widgets

# Input
SOURCES += main.cpp
it doesn't work
and neither
######################################################################
# Automatically generated by qmake (3.0) Sat Feb 21 19:51:47 2015
######################################################################

TEMPLATE = app
TARGET = hello
INCLUDEPATH += .


# Input
SOURCES += main.cpp
QT+=widgets
ok .. trying .. wait 1 sec..
no ..
 
7:03 PM
Still the error is No such file QtWidgets?
 
yes
 
Did qmake regenerate Makefile? How Makefile.Release looks like? What are -I<directory> arguments to the compiler?
"qmake -project" re-writes .pro completely. It's not good if it was changed by hand.
 
Yes there are Makefile, Makefile.Release and Makefile.Debug
here is the complete error:
mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory 'C:/Users/Stefano/Desktop/hello'
g++ -c -pipe -fno-keep-inline-dllexport -O2 -frtti -Wall -Wextra -fexc
eptions -mthreads -DUNICODE -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -
DQT_NEEDS_QMAIN -I. -I"." -I"\include" -I"\include\QtGui" -I"\include\
QtCore" -I"release" -I"..\..\..\..\Qt\Qt5.4.0MinGw\5.4\mingw491_32\mks
pecs\win32-g++" -o release\main.o main.cpp
main.cpp:1:21: fatal error: QtWidgets: No such file or directory
#include <QtWidgets>
 
"qmake" without arguments re-writes Makefile, Makefile.Release and Makefile.Debug based upon .pro file contents
 
so I should type
qmake -project
qmake
qmake -hello.pro
mingw32-make
 
7:09 PM
qmake -project
qmake
mingw32-make release
 
mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory 'C:/Users/Stefano/Desktop/hello'
g++ -c -pipe -fno-keep-inline-dllexport -O2 -frtti -Wall -Wextra -fexc
eptions -mthreads -DUNICODE -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -
DQT_NEEDS_QMAIN -I. -I"." -I"\include" -I"\include\QtGui" -I"\include\
QtCore" -I"release" -I"..\..\..\..\Qt\Qt5.4.0MinGw\5.4\mingw491_32\mks
pecs\win32-g++" -o release\main.o main.cpp
main.cpp:1:21: fatal error: QtWidgets: No such file or directory
#include <QtWidgets>
 
But qmake -project should be omitted if you already have good .pro file
How it comes that -I"\include\QtGui" with leading "\"??
 
'cause the prefix is C:/Qt/Qt5.4.0MinGw/5.4/mingw491_32
and to reach next folder it's needed an extra /
 
Well, it should be full path like -I"C:\Qt\Qt5.4.0MinGw\5.4\mingw491_32\include\QtGui"
 
wait ... we're nearly there ..
I've edited the prefix to C:/Qt/Qt5.4.0MinGw/5.4/mingw491_32/
removed the leading /
from all other specs
and it indeeed generated a hello.exe!!
but
 
7:16 PM
I guess it crashes?
Try to put qt.conf into release subdirectory near to .exe
 
yes beacuse it says "the procedure ntry point _ ... could not be located in the dynamic library C:\Qt\Qt5.4.0MinGw\5.4\mingw491_32\bin\QtCore.dll"
there is also a main.o file in the subdirectory release
but when I looked inside \bin I found Qt5Core.dll
 
The error is not "QtCore.dll not found" but "entry point xxx not found in QtCore.dll"
That's really strange
 
entry point __gxx_personality_v0
 
7:32 PM
Where are lbstdc++-6.dll and libgcc_s_seh-1.dll? Are they on PATH?
 
no! what should I write in PATH ?
 
First, try to add these dll's to C:\Qt\Qt5.4.0MinGw\5.4\mingw491_32\bin and see if it helps
 
where do I find them?
 
They should be in the same directory as gcc, g++ etc.
 
I found lbstdc++-6.dll and libgcc_s_dw2-1.dll
 
7:48 PM
Ah, sure. I forgot it's 32-bit version.
 
so I paste both in the Qt root directory (prefix)
but there are already these files!
 
Well, I'm stuck. Try to add "LIBS *= stdc++" to .pro file and rebuild the project.
 
ahahhahaa
mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory 'C:/Users/Stefano/Desktop/hello'
g++ -c -pipe -fno-keep-inline-dllexport -O2 -frtti -Wall -Wextra -fexc
eptions -mthreads -DUNICODE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LI
B -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I. -I"." -I"..\..\..\..\Qt\Qt5.4.0Mi
nGw\5.4\mingw491_32\include" -I"..\..\..\..\Qt\Qt5.4.0MinGw\5.4\mingw4
91_32\include\QtWidgets" -I"..\..\..\..\Qt\Qt5.4.0MinGw\5.4\mingw491_3
2\include\QtGui" -I"..\..\..\..\Qt\Qt5.4.0MinGw\5.4\mingw491_32\includ
Well I THANK YOU VERY MUCH for your support!
(really! i'm not joking)
but it's over 2/3 days I'm stuck with this installation
I can't stand it no more
I move to ubuntu 14.10 and then install qt in it
if it doesn't work at least I'm with ubuntu ;)
so if you wish I can send you a message with the conclusion of the installation in UBUNTU ;)
 
8:04 PM
Didn't do this with official package either. Personally I use winbuilds.org provided binary build which is OK.
 
sorry? winbuilds better than gcc ??
have you tried gcc tmd?? it's superman! ;) I highly recommend it!
 
Winbuilds is custom build of gcc + libraries (including Qt).
Think it like unofficial package repository, no more, no less.
Do you mean GCC-TDM?
 
ok, perfect ;) but when I'm in ubunut gcc is already installed isn't it?
I know, but I think qt should be more easily installed in ubuntu than in bloody w8.1
 
It's OK but they don't provide pre-compiled 64-bit Qt
There are several other projects providing 64-bit MinGW with Qt precompiled. I chose Winbuilds
 
are you using w8.1?
 
8:08 PM
W7
But I guess it should not matter
 
thanks
ok .. so .. this is my last chat mesage in w8.1 OS
you're good man (or woman) ;) see you!
 
Bye. Hope you anyway got some info on Qt which helps you on other platform too.
 

last day (15 days later) »