PDA

View Full Version : Qt resources system don't work for a simple example



P'tit Ju
24th August 2012, 08:52
Hey guys,

Since I have installed Qt 4.8.2, I can't use the Qt system resources because the resources are not compiled during compilation. Maybe is there another feature to be activated now ? I work with Qt 4.8.2 on Windows Vista and I don't try yet if I have the same problem in my Linux system. For information, I have download the Qt libraries 4.8.2 for Windows (minGW 4.4, 318 MB) and Qt Creator 2.5.2 for Windows (30 MB) on Nokia downloads page.

Here is my simple example :

Test.pro

#-------------------------------------------------
#
# Project created by QtCreator 2012-08-21T18:03:11
#
#-------------------------------------------------

QT += core gui

#The follow line appears with Qt 4.8.2
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TEMPLATE = app
CONFIG += release
MOC_DIR = ./moc/
RCC_DIR = ./qrc/
OBJECTS_DIR = ./obj/
DESTDIR = ./
TARGET = Test

SOURCES += main.cpp

HEADERS +=

RESOURCES += ressources.qrc


main.cpp

#include <QApplication>
#include <QTabWidget>
#include <QTextEdit>
#include <QCalendarWidget>

int main(int argc, char *argv[])
{
QApplication a(argc, argv);

QTabWidget tabWidget;

tabWidget.setMovable(true);

QTextEdit textEdit;
tabWidget.addTab(&textEdit, QIcon(":/Desktop.png"), "Text edit");
QCalendarWidget calendarWidget;
tabWidget.addTab(&calendarWidget, QIcon(":/Star.png"), "Calendar widget");

tabWidget.show();

return a.exec();
}


resources.qrc

<RCC>
<qresource>
<file>Desktop.png</file>
<file>Star.png</file>
</qresource>
</RCC>


The .pro, .cpp, .qrc and .png files are in the same location of course.
Finally, images doesn't appear during execution because they can't be loaded.

During compilation when I used Qt 4.8.0, these commands appeared :

rcc -name ressources ressources.qrc -o qrc\qrc_ressources.cpp
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT
-DNDEBUG -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX
-DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT
-DQT_NEEDS_QMAIN -I'd:/Applis/Qt/4.8.2/include/QtCore' -I'd:/Applis/Qt/4.8.2/include/QtGui'
-I'd:/Applis/Qt/4.8.2/include' -I'.' -I'd:/Applis/Qt/4.8.2/include/ActiveQt' -I'./moc'
-I'd:/Applis/Qt/4.8.2/mkspecs/win32-g++' -o ./qrc_ressources.o ./qrc/qrc_ressources.cpp

And of course, the generated .o file was added during the executable creation.

Have you any idea ?

Regards,

P'tit Ju

yeye_olive
24th August 2012, 10:18
How do you know that the resources cannot be loaded? Have you tried reading them directly with QFile? For all we know the problem might be in the PNG rendering, or the files may be corrupted.

P'tit Ju
24th August 2012, 11:11
I know that because whe you try to load them with QPixmap, they are null and these pictures are from Qt : 81458146 .
If you want, here is the output of the compilation (some words are in french because I am) and you see that the resource file doesn't appear anywhere :


12:05:20: Le processus "D:\Applis\Qt\mingw\bin\mingw32-make.exe" s'est terminé normalement.
12:05:20: Configuration inchangée, étape QMake sautée.
12:05:20: Débute : "D:\Applis\Qt\mingw\bin\mingw32-make.exe"
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I'd:/Applis/Qt/4.8.2/include/QtCore' -I'd:/Applis/Qt/4.8.2/include/QtGui' -I'd:/Applis/Qt/4.8.2/include' -I'd:/Applis/Qt/4.8.2/include/ActiveQt' -I'moc' -I'd:/Applis/Qt/4.8.2/mkspecs/win32-g++' -o obj/main.o main.cpp
g++ -Wl,-s -mthreads -Wl,-subsystem,windows -o Test.exe obj/main.o -L'd:/Applis/Qt/4.8.2/lib' -lmingw32 -lqtmain -lQtGui4 -lQtCore4
12:05:23: Le processus "D:\Applis\Qt\mingw\bin\mingw32-make.exe" s'est terminé normalement.

The only solution I found for moment is to do this manuallly in a Qt console : rcc -name ressources ressources.qrc -o qrc\qrc_ressources.cpp .
And in the .pro file, add this line : SOURCES += qrc_ressources.cpp .
It works well but it's not practical...

P'tit Ju
26th August 2012, 11:18
I try it on my Xubuntu Linux with Qt 4.8.2.0 and it works. Here is the compilation output :


12:11:47: Configuration inchangée, étape QMake sautée.
12:11:47: Débute : "/usr/bin/make" -w
make: Entering directory `/home/julien/Test'
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/Qt-4.8.2/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/Qt-4.8.2/include/QtCore -I/usr/local/Trolltech/Qt-4.8.2/include/QtGui -I/usr/local/Trolltech/Qt-4.8.2/include -Imoc -o obj/main.o main.cpp
/usr/local/Trolltech/Qt-4.8.2/bin/rcc -name ressources ressources.qrc -o qrc/qrc_ressources.cpp
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/Qt-4.8.2/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/Qt-4.8.2/include/QtCore -I/usr/local/Trolltech/Qt-4.8.2/include/QtGui -I/usr/local/Trolltech/Qt-4.8.2/include -Imoc -o obj/qrc_ressources.o qrc/qrc_ressources.cpp
g++ -Wl,-O1 -Wl,-rpath,/usr/local/Trolltech/Qt-4.8.2/lib -o Test obj/main.o obj/qrc_ressources.o -L/usr/local/Trolltech/Qt-4.8.2/lib -lQtGui -L/usr/local/Trolltech/Qt-4.8.2/lib -L/usr/X11R6/lib -lQtCore -lpthread
make: Leaving directory `/home/julien/Test'
12:11:50: Le processus "/usr/bin/make" s'est terminé normalement.

You can see there is some text that doesn't appear in the Windows compilation output. Is it a problem with qmake ?
Is there anybody who has a solution or an idea ? Thanks.

P'tit Ju
26th August 2012, 22:29
I have just discovered another big problem wich is similar too. I can't use a simple example with ui, just creating a new project with ui and directly compiling... For a ui file named "Widget.ui", after doing qmake and make, the "ui_Widget.h" file is not generated and so, I got some compilator errors that say it is impossible to find "ui_Widget.h".
I try to build Qt sources like I did on my Linux, but it fails with this ui problem whereas I did'nt met any problem on my Linux. I am using MinGW compilator.

It is very hopeless...
Is there someone that have the same problems (ui or qrc, or both or other) like me or I am the only ?

ChrisW67
27th August 2012, 02:15
The UI files are not processed unless they are listed in the FORMS variable of the pro file.
If you change the PRO you need to run qmake (or your IDE has to on your behalf).

Your last compile output shows that the resource data object file is not being linked into your application. Your first course of action is to do a clean build of the entire program including running qmake. If it still does not work in your development environment then you need to post the entire Compile output.

P'tit Ju
27th August 2012, 08:21
Yes, I know that and as I said, I created another new ui project with QtCreator wizard. Here the source files and then the compilator output :

T.pro

#-------------------------------------------------
#
# Project created by QtCreator 2012-08-26T23:17:02
#
#-------------------------------------------------

QT += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = T
TEMPLATE = app


SOURCES += main.cpp\
Widget.cpp

HEADERS += Widget.h

FORMS += Widget.ui


main.cpp

#include <QApplication>
#include "Widget.h"

int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Widget w;
w.show();

return a.exec();
}


Widget.cpp

#include "Widget.h"
#include "ui_Widget.h"

Widget::Widget(QWidget *parent) :
QWidget(parent),
ui(new Ui::Widget)
{
ui->setupUi(this);
}

Widget::~Widget()
{
delete ui;
}


Widget.ui

<ui version="4.0">
<class>Widget</class>
<widget class="QWidget" name="Widget" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle" >
<string>Widget</string>
</property>
</widget>
<layoutDefault spacing="6" margin="11" />
<pixmapfunction></pixmapfunction>
<resources/>
<connections/>
</ui>


The compilator output doing the action "Rebuild the project "T" ":


09:17:09: Exécution des étapes pour le projet T...
09:17:09: Débute : "D:\Applis\Qt\mingw\bin\mingw32-make.exe" clean
rm moc_Widget.cpp
rm main.o Widget.o moc_Widget.o
rm: cannot lstat `moc_Widget.cpp': No such file or directory
mingw32-make: [compiler_moc_header_clean] Error 1 (ignored)
rm: cannot lstat `Widget.o': No such file or directory
rm: cannot lstat `moc_Widget.o': No such file or directory
mingw32-make: [clean] Error 1 (ignored)
09:17:10: Le processus "D:\Applis\Qt\mingw\bin\mingw32-make.exe" s'est terminé normalement.
09:17:10: Configuration inchangée, étape QMake sautée.
09:17:10: Débute : "D:\Applis\Qt\mingw\bin\mingw32-make.exe"
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I'd:/Applis/Qt/4.8.2/include/QtCore' -I'd:/Applis/Qt/4.8.2/include/QtGui' -I'd:/Applis/Qt/4.8.2/include' -I'd:/Applis/Qt/4.8.2/include/ActiveQt' -I'.' -I'd:/Applis/Qt/4.8.2/mkspecs/win32-g++' -o main.o main.cpp
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I'd:/Applis/Qt/4.8.2/include/QtCore' -I'd:/Applis/Qt/4.8.2/include/QtGui' -I'd:/Applis/Qt/4.8.2/include' -I'd:/Applis/Qt/4.8.2/include/ActiveQt' -I'.' -I'd:/Applis/Qt/4.8.2/mkspecs/win32-g++' -o Widget.o Widget.cpp
Widget.cpp:2:23: error: ui_Widget.h: No such file or directory
Widget.cpp: In constructor 'Widget::Widget(QWidget*)':
Widget.cpp:6: error: invalid use of incomplete type 'struct Ui::Widget'
Widget.h:7: error: forward declaration of 'struct Ui::Widget'
Widget.cpp:8: error: invalid use of incomplete type 'struct Ui::Widget'
Widget.h:7: error: forward declaration of 'struct Ui::Widget'
Widget.cpp: In destructor 'virtual Widget::~Widget()':
Widget.cpp:13: warning: possible problem detected in invocation of delete operator:
Widget.cpp:13: warning: invalid use of incomplete type 'struct Ui::Widget'
Widget.h:7: warning: forward declaration of 'struct Ui::Widget'
Widget.cpp:13: note: neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined.
mingw32-make: *** [Widget.o] Error 1
09:17:13: Le processus "D:\Applis\Qt\mingw\bin\mingw32-make.exe" s'est terminé avec le code 2.
Erreur lors de la compilation/déploiement du projet T (cible : Desktop)
Lors de l'exécution de l'étape "Make"

I have not idea about this issue, I try to create manually in a console the ui_Widget.h and then, it works of course. The only common point is that rcc.exe et uic.exe are in the same folder but qmake.exe too ...

ChrisW67
27th August 2012, 09:18
The compile output you show and the PRO file you show do not match. The build is not running uic because the rules are not in the Makefile. Run qmake manually to recreate Makefile and try again.

This is what your project build looks like on my Linux machine (the MinGW commands are similar and I added your original resources for completeness):


$ ls
Desktop.png main.cpp resources.qrc Star.png T.pro Widget.cpp Widget.h Widget.ui

$ qmake

$ make
/usr/bin/uic Widget.ui -o ui_Widget.h // <<< This is missing in your build
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o main.o main.cpp
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o Widget.o Widget.cpp
/usr/bin/moc -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. Widget.h -o moc_Widget.cpp
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o moc_Widget.o moc_Widget.cpp
/usr/bin/rcc -name resources resources.qrc -o qrc_resources.cpp // <<< This is missing in your build
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o qrc_resources.o qrc_resources.cpp
g++ -Wl,-O1 -o T main.o Widget.o moc_Widget.o qrc_resources.o -L/usr/lib64/qt4 -lQtGui -L/usr/lib64 -L/usr/lib64/qt4 -L/usr/X11R6/lib -lQtCore -lgthread-2.0 -lrt -lglib-2.0 -lpthread

P'tit Ju
27th August 2012, 10:33
Oh, I was explaining that I created a new project, not mixing both but it is not a problem. If you take just the last example files with ui (only by creating shown files in a folder named T), I opened a Qt console and I did what you said. Here is the compilator output, again, with the same errors :


Setting up a MinGW/Qt only environment...
-- QTDIR set to D:\Applis\Qt\4.8.2
-- PATH set to D:\Applis\Qt\4.8.2\bin
-- Adding D:\Applis\Qt\mingw\bin to PATH
-- Adding C:\Windows\System32 to PATH
-- QMAKESPEC set to win32-g++

D:\Applis\Qt\4.8.2>c:

C:\>cd Users\Julien\Desktop\T

C:\Users\Julien\Desktop\T>dir
Le volume dans le lecteur C s'appelle ACER
Le numéro de série du volume est C253-73CE

Répertoire de C:\Users\Julien\Desktop\T

27/08/2012 11:28 <REP> .
27/08/2012 11:28 <REP> ..
26/08/2012 23:17 179 main.cpp
27/08/2012 09:18 362 T.pro
26/08/2012 23:17 201 Widget.cpp
26/08/2012 23:17 317 Widget.h
26/08/2012 23:17 441 Widget.ui
5 fichier(s) 1*500 octets
2 Rép(s) 14*285*438*976 octets libres

C:\Users\Julien\Desktop\T>qmake
d:\Applis\Qt\4.8.2\mkspecs\features\debug_and_rele ase.prf:1: Unknown test functi
on: addExclusiveBuilds

C:\Users\Julien\Desktop\T>make
g++ -c -frtti -fexceptions -mthreads -g -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -
DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"d:\Applis
\Qt\4.8.2\include\QtCore" -I"d:\Applis\Qt\4.8.2\include\QtGui" -I"d:\Applis\Qt\4
.8.2\include" -I"d:\Applis\Qt\4.8.2\include\ActiveQt" -I"." -I"d:\Applis\Qt\4.8.
2\mkspecs\win32-g++" -o main.o main.cpp
g++ -c -frtti -fexceptions -mthreads -g -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -
DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"d:\Applis
\Qt\4.8.2\include\QtCore" -I"d:\Applis\Qt\4.8.2\include\QtGui" -I"d:\Applis\Qt\4
.8.2\include" -I"d:\Applis\Qt\4.8.2\include\ActiveQt" -I"." -I"d:\Applis\Qt\4.8.
2\mkspecs\win32-g++" -o Widget.o Widget.cpp
Widget.cpp:2:23: error: ui_Widget.h : No such file or directory
Widget.cpp: In constructor 'Widget::Widget(QWidget*)':
Widget.cpp:6: erreur: invalid use of incomplete type 'struct Ui::Widget'
Widget.h:7: erreur: forward declaration of 'struct Ui::Widget'
Widget.cpp:8: erreur: invalid use of incomplete type 'struct Ui::Widget'
Widget.h:7: erreur: forward declaration of 'struct Ui::Widget'
Widget.cpp: In destructor 'virtual Widget::~Widget()':
Widget.cpp:13: attention : problème possible détecté dans l'invocation de l'opér
ateur delete:
Widget.cpp:13: attention : invalid use of incomplete type 'struct Ui::Widget'
Widget.h:7: attention : forward declaration of 'struct Ui::Widget'
Widget.cpp:13: note: neither the destructor nor the class-specific operator dele
te will be called, even if they are declared when the class is defined.
mingw32-make: *** [Widget.o] Error 1

C:\Users\Julien\Desktop\T>

I don't know if it can help but I give the generated Makefile below :

################################################## ###########################
# Makefile for building: T
# Generated by qmake (2.01a) (Qt 4.8.2) on: lun. 27. août 11:28:57 2012
# Project: T.pro
# Template: app
# Command: d:\Applis\Qt\4.8.2\bin\qmake.exe -o Makefile T.pro
################################################## ###########################

####### Compiler, tools and options

CC = gcc
CXX = g++
DEFINES = -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN
CFLAGS = -g -Wall $(DEFINES)
CXXFLAGS = -frtti -fexceptions -mthreads -g -Wall $(DEFINES)
INCPATH = -I"d:\Applis\Qt\4.8.2\include\QtCore" -I"d:\Applis\Qt\4.8.2\include\QtGui" -I"d:\Applis\Qt\4.8.2\include" -I"d:\Applis\Qt\4.8.2\include\ActiveQt" -I"." -I"d:\Applis\Qt\4.8.2\mkspecs\win32-g++"
LINK = g++
LFLAGS = -mthreads -Wl,-subsystem,windows
LIBS = -L"d:\Applis\Qt\4.8.2\lib" -lmingw32 -lqtmaind -lQtGui4 -lQtCore4
QMAKE = d:\Applis\Qt\4.8.2\bin\qmake.exe
IDC = d:\Applis\Qt\4.8.2\bin\idc.exe
IDL = midl
ZIP = zip -r -9
DEF_FILE =
RES_FILE =
COPY = copy /y
SED =
COPY_FILE = $(COPY)
COPY_DIR = xcopy /s /q /y /i
DEL_FILE = del
DEL_DIR = rmdir
MOVE = move
CHK_DIR_EXISTS= if not exist
MKDIR = mkdir
INSTALL_FILE = $(COPY_FILE)
INSTALL_PROGRAM = $(COPY_FILE)
INSTALL_DIR = $(COPY_DIR)

####### Output directory

OBJECTS_DIR = .

####### Files

SOURCES = main.cpp \
Widget.cpp moc_Widget.cpp
OBJECTS = main.o \
Widget.o \
moc_Widget.o
DIST =
QMAKE_TARGET = T
DESTDIR = #avoid trailing-slash linebreak
TARGET = T.exe
DESTDIR_TARGET = T.exe

####### Implicit rules

.SUFFIXES: .cpp .cc .cxx .c

.cpp.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

.cc.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

.cxx.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

.c.o:
$(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<

####### Build rules

first: all
all: Makefile $(DESTDIR_TARGET)

$(DESTDIR_TARGET): $(OBJECTS)
$(LINK) $(LFLAGS) -o $(DESTDIR_TARGET) $(OBJECTS) $(LIBS)

Makefile: T.pro d:/Applis/Qt/4.8.2/mkspecs/win32-g++/qmake.conf d:/Applis/Qt/4.8.2/mkspecs/qconfig.pri \
d:/Applis/Qt/4.8.2/mkspecs/modules/qt_webkit_version.pri \
d:/Applis/Qt/4.8.2/mkspecs/features/qt_functions.prf \
d:/Applis/Qt/4.8.2/mkspecs/features/qt_config.prf \
d:/Applis/Qt/4.8.2/mkspecs/features/win32/default_pre.prf \
d:/Applis/Qt/4.8.2/mkspecs/features/win32/default_post.prf \
d:/Applis/Qt/4.8.2/mkspecs/features/win32/rtti.prf \
d:/Applis/Qt/4.8.2/mkspecs/features/win32/exceptions.prf \
d:/Applis/Qt/4.8.2/mkspecs/features/win32/stl.prf \
d:/Applis/Qt/4.8.2/mkspecs/features/shared.prf \
d:/Applis/Qt/4.8.2/mkspecs/features/debug.prf \
d:/Applis/Qt/4.8.2/mkspecs/features/debug_and_release.prf \
d:/Applis/Qt/4.8.2/mkspecs/features/warn_on.prf \
d:/Applis/Qt/4.8.2/mkspecs/features/qt.prf \
d:/Applis/Qt/4.8.2/mkspecs/features/win32/thread.prf \
d:/Applis/Qt/4.8.2/mkspecs/features/moc.prf \
d:/Applis/Qt/4.8.2/mkspecs/features/win32/windows.prf \
d:/Applis/Qt/4.8.2/mkspecs/features/include_source_dir.prf \
d:/Applis/Qt/4.8.2/lib/qtmaind.prl
$(QMAKE) -o Makefile T.pro
d:\Applis\Qt\4.8.2\mkspecs\qconfig.pri:
d:\Applis\Qt\4.8.2\mkspecs\modules\qt_webkit_versi on.pri:
d:\Applis\Qt\4.8.2\mkspecs\features\qt_functions.p rf:
d:\Applis\Qt\4.8.2\mkspecs\features\qt_config.prf:
d:\Applis\Qt\4.8.2\mkspecs\features\win32\default_ pre.prf:
d:\Applis\Qt\4.8.2\mkspecs\features\win32\default_ post.prf:
d:\Applis\Qt\4.8.2\mkspecs\features\win32\rtti.prf :
d:\Applis\Qt\4.8.2\mkspecs\features\win32\exceptio ns.prf:
d:\Applis\Qt\4.8.2\mkspecs\features\win32\stl.prf:
d:\Applis\Qt\4.8.2\mkspecs\features\shared.prf:
d:\Applis\Qt\4.8.2\mkspecs\features\debug.prf:
d:\Applis\Qt\4.8.2\mkspecs\features\debug_and_rele ase.prf:
d:\Applis\Qt\4.8.2\mkspecs\features\warn_on.prf:
d:\Applis\Qt\4.8.2\mkspecs\features\qt.prf:
d:\Applis\Qt\4.8.2\mkspecs\features\win32\thread.p rf:
d:\Applis\Qt\4.8.2\mkspecs\features\moc.prf:
d:\Applis\Qt\4.8.2\mkspecs\features\win32\windows. prf:
d:\Applis\Qt\4.8.2\mkspecs\features\include_source _dir.prf:
d:\Applis\Qt\4.8.2\lib\qtmaind.prl:
qmake: FORCE
@$(QMAKE) -o Makefile T.pro

dist:
$(ZIP) T.zip $(SOURCES) $(DIST) T.pro d:\Applis\Qt\4.8.2\mkspecs\qconfig.pri d:\Applis\Qt\4.8.2\mkspecs\modules\qt_webkit_versi on.pri d:\Applis\Qt\4.8.2\mkspecs\features\qt_functions.p rf d:\Applis\Qt\4.8.2\mkspecs\features\qt_config.prf d:\Applis\Qt\4.8.2\mkspecs\features\win32\default_ pre.prf d:\Applis\Qt\4.8.2\mkspecs\features\win32\default_ post.prf d:\Applis\Qt\4.8.2\mkspecs\features\win32\rtti.prf d:\Applis\Qt\4.8.2\mkspecs\features\win32\exceptio ns.prf d:\Applis\Qt\4.8.2\mkspecs\features\win32\stl.prf d:\Applis\Qt\4.8.2\mkspecs\features\shared.prf d:\Applis\Qt\4.8.2\mkspecs\features\debug.prf d:\Applis\Qt\4.8.2\mkspecs\features\debug_and_rele ase.prf d:\Applis\Qt\4.8.2\mkspecs\features\warn_on.prf d:\Applis\Qt\4.8.2\mkspecs\features\qt.prf d:\Applis\Qt\4.8.2\mkspecs\features\win32\thread.p rf d:\Applis\Qt\4.8.2\mkspecs\features\moc.prf d:\Applis\Qt\4.8.2\mkspecs\features\win32\windows. prf d:\Applis\Qt\4.8.2\mkspecs\features\include_source _dir.prf d:\Applis\Qt\4.8.2\lib\qtmaind.prl HEADERS SOURCES OBJECTIVE_SOURCES

clean: compiler_clean
-$(DEL_FILE) main.o Widget.o moc_Widget.o

distclean: clean
-$(DEL_FILE) $(DESTDIR_TARGET)
-$(DEL_FILE) Makefile

mocclean: compiler_moc_header_clean compiler_moc_source_clean

mocables: compiler_moc_header_make_all compiler_moc_source_make_all

compiler_moc_header_make_all: moc_Widget.cpp
compiler_moc_header_clean:
-$(DEL_FILE) moc_Widget.cpp
moc_Widget.cpp: Widget.h
D:\Applis\Qt\4.8.2\bin\moc.exe $(DEFINES) $(INCPATH) -D__GNUC__ -DWIN32 Widget.h -o moc_Widget.cpp

compiler_moc_source_make_all:
compiler_moc_source_clean:
compiler_clean: compiler_moc_header_clean



####### Compile

main.o: main.cpp Widget.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp

Widget.o: Widget.cpp Widget.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o Widget.o Widget.cpp

moc_Widget.o: moc_Widget.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_Widget.o moc_Widget.cpp

####### Install

install: FORCE

uninstall: FORCE

FORCE:



EDIT: Do you want to see the output on my Linux with the same project ? I don't try but I'm sure it works.

ChrisW67
28th August 2012, 00:03
These errors:

C:\Users\Julien\Desktop\T>qmake
d:\Applis\Qt\4.8.2\mkspecs\features\debug_and_rele ase.prf:1: Unknown test function: addExclusiveBuilds
indicate that there is something broken in your Qt install itself. The missing function is defined in "mkspecs/features/exclusive_builds.prf", so see if that file is present or corrupt. You may need to reinstall Qt if the file has become corrupted.

P'tit Ju
28th August 2012, 08:17
Ok, thank you for this advise but this file doesn't seem corrupt. I don't know if it is necessary giving you contents file :


# fixExclusiveOutputDirs(1config, 2config)
# Change all output paths that references 2config to have the string 1config in them
defineTest(fixExclusiveOutputDirs) {
unset(firstBuild)
unset(secondBuild)
unset(appendFirstBuild)
firstBuild = $$1
secondBuild = $$2
count(ARGS, 2, greaterThan):isEqual($$list($$lower($$3)), false):appendFirstBuild = false
else:appendFirstBuild = true

isEmpty(QMAKE_DIR_REPLACE):QMAKE_DIR_REPLACE += OBJECTS_DIR MOC_DIR RCC_DIR
lessThan(firstBuild, $$secondBuild):eval($${firstBuild}_and_$${secondBu ild}_target:QMAKE_DIR_REPLACE += DESTDIR)
else:eval($${secondBuild}_and_$${firstBuild}_targe t:QMAKE_DIR_REPLACE += DESTDIR)
for(fix, QMAKE_DIR_REPLACE) {
isEmpty($$fix)|isEqual($$fix, .) {
eval($$fix = $${firstBuild})
} else:contains($$list($$first($$fix)), .*$${secondBuild}.*) {
eval($$fix ~= s/$${secondBuild}/$${firstBuild}/gi)
} else:isEqual(appendFirstBuild, true):!contains($$list($$first($$fix)), .*$${firstBuild}.*) {
contains($$list($${first($$fix)}), .*/$):eval($$fix = $${first($$fix)}$${firstBuild})
else:eval($$fix = $${first($$fix)}-$${firstBuild})
}
export($$fix)
}
return(true)
}

# addExclusiveBuilds(1config, 1name, 2config, 2name)
# Adds two BUILDS which are exclusive to each other.
defineTest(addExclusiveBuilds) {
unset(firstBuild)
unset(firstBuildName)
unset(secondBuild)
unset(secondBuildName)

firstBuild = $$1
firstBuildName = $$2
secondBuild = $$3
secondBuildName = $$4

contains(TEMPLATE, subdirs) {
eval(sub_$${firstBuildName}.target = $$firstBuild)
export(sub_$${firstBuildName}.target)
eval(sub_$${firstBuildName}.CONFIG = recursive)
export(sub_$${firstBuildName}.CONFIG)
eval(sub_$${secondBuildName}.target = $$secondBuild)
export(sub_$${secondBuildName}.target)
eval(sub_$${secondBuildName}.CONFIG = recursive)
export(sub_$${secondBuildName}.CONFIG)
QMAKE_EXTRA_TARGETS += sub_$${firstBuildName} sub_$${secondBuildName}
export(QMAKE_EXTRA_TARGETS)
} else:!build_pass {
first_BUILDS =
second_BUILDS =
suffix_BUILDS = Build

isEmpty(BUILDS): BUILDPERMUTATIONS = $$suffix_BUILDS
else: BUILDPERMUTATIONS = $$BUILDS

for(permutation, BUILDPERMUTATIONS) {
permutation ~= s/$${suffix_BUILDS}$//
isEmpty(permutation): permutationName =
else: permutationName = -$$permutation
# Makefile target rule
eval($${firstBuildName}$${permutation}.target = $${firstBuild}$$lower($${permutationName}))
export($${firstBuildName}$${permutation}.target)
# IDE name
eval($${firstBuildName}$${permutation}.name = $${firstBuildName}$${permutationName})
export($${firstBuildName}$${permutation}.name)
# prl import CONFIG option
eval($${firstBuildName}$${permutation}.PRL_CONFIG = $${firstBuild}$${permutation})
export($${firstBuildName}$${permutation}.PRL_CONFI G)
# Individual CONFIG option
eval($${firstBuildName}$${permutation}.CONFIG = $${firstBuild} $${firstBuildName}Build $$eval($${permutation}.CONFIG))
export($${firstBuildName}$${permutation}.CONFIG)

eval($${secondBuildName}$${permutation}.target = $${secondBuild}$$lower($${permutationName}))
export($${secondBuildName}$${permutation}.target)
eval($${secondBuildName}$${permutation}.name = $${secondBuildName}$${permutationName})
export($${secondBuildName}$${permutation}.name)
eval($${secondBuildName}$${permutation}.PRL_CONFIG = $${secondBuild}$${permutation})
export($${secondBuildName}$${permutation}.PRL_CONF IG)
eval($${secondBuildName}$${permutation}.CONFIG = $${secondBuild} $${secondBuildName}Build $$eval($${permutation}.CONFIG))
export($${secondBuildName}$${permutation}.CONFIG)

first_BUILDS += $${firstBuildName}$${permutation}
second_BUILDS += $${secondBuildName}$${permutation}
}

# A mutual exclusive block.
CONFIG($${firstBuild}, $${firstBuild}|$${secondBuild}): BUILDS = $$first_BUILDS $$second_BUILDS
else: BUILDS = $$second_BUILDS $$first_BUILDS
export(BUILDS)
} else {
eval($${firstBuildName}Build:fixExclusiveOutputDir s($$firstBuild, $$secondBuild, false))
eval($${secondBuildName}Build:fixExclusiveOutputDi rs($$secondBuild, $$firstBuild, false))
}
return(true)
}


Maybe this file is not read and so, the function is unknown.

P'tit Ju
1st September 2012, 11:15
I tried to install again Qt but I have always this problem and I have not a little idea...