Bonjour,

J'ai un projet qui compile et fonctionne très bien quand tous les fichiers (headers et sources) sont dans un dossier unique. Quand j'essaye de faire des dossiers séparés, je ne m'en sors pas...

J'ai généré mon .pro automatiquement, avec qmake -project, et je l'ai édité pour rajouter le module SQL et modifier la variable INCLUDEPATH (ou DEPENDPATH je ne sais plus). J'ai ça :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 
TEMPLATE = app
TARGET = 
DEPENDPATH += . headers sources
INCLUDEPATH += . headers sources
 
QT += sql
 
# Input
HEADERS += headers/messagesUtilisateur.h \
           headers/myAboutTab.h \
           headers/myAddTab.h \
           headers/myMainWindow.h \
           headers/mySearchTab.h \
           headers/mySQL.h \
           headers/myWelcomeTab.h
SOURCES += sources/main.cpp \
           sources/myAboutTab.cpp \
           sources/myAddTab.cpp \
           sources/myMainWindow.cpp \
           sources/mySearchTab.cpp \
           sources/mySQL.cpp \
           sources/myWelcomeTab.cpp

J'essaye ensuite de compiler, mais les fichiers ne sont pas trouvés...

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
 
Setting up a MinGW/Qt only environment...
-- QTDIR set to C:\Qt\2010.04\qt
-- PATH set to C:\Qt\2010.04\qt\bin
-- Adding C:\Qt\2010.04\bin to PATH
-- Adding C:\Windows\System32 to PATH
-- QMAKESPEC set to win32-g++
 
C:\Qt\2010.04\qt>cd c:\Projets\DiskDB
 
c:\Projets\DiskDB>qmake
 
c:\Projets\DiskDB>mingw32-make
mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `c:/Projets/DiskDB'
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
DQT_DLL -DQT_SQL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_Q
MAIN -I"..\..\Qt\2010.04\qt\include\QtCore" -I"..\..\Qt\2010.04\qt\include\QtGui
" -I"..\..\Qt\2010.04\qt\include\QtSql" -I"..\..\Qt\2010.04\qt\include" -I"." -I
"..\..\Qt\2010.04\qt\include\ActiveQt" -I"debug" -I"..\..\Qt\2010.04\qt\mkspecs\
win32-g++" -o debug\main.o sources\main.cpp
sources\main.cpp:4:19: error: mySQL.h: No such file or directory
sources\main.cpp:5:33: error: messagesUtilisateur.h: No such file or directory
sources\main.cpp:6:26: error: myMainWindow.h: No such file or directory
sources\main.cpp:7:26: error: myWelcomeTab.h: No such file or directory
sources\main.cpp:8:22: error: myAddTab.h: No such file or directory
sources\main.cpp: In function 'int qMain(int, char**)':
sources\main.cpp:20: error: 'MySQL_openDatabase' was not declared in this scope
sources\main.cpp:28: error: 'MyMainWindow' was not declared in this scope
sources\main.cpp:28: error: expected ';' before 'fenetrePrincipale'
sources\main.cpp:31: error: 'fenetrePrincipale' was not declared in this scope
sources\main.cpp:40: error: 'QMessageBox' has not been declared
sources\main.cpp:42: error: 'MESSAGE_ERREUR_CONNEXION' was not declared in this
scope
sources\main.cpp:48: error: 'QMessageBox' has not been declared
sources\main.cpp:50: error: 'MESSAGE_ERREUR_CREATION_BDD' was not declared in th
is scope
sources\main.cpp:56: error: 'QMessageBox' has not been declared
sources\main.cpp:58: error: 'MESSAGE_ERREUR_CONNEXION' was not declared in this
scope
sources\main.cpp:62: error: invalid use of incomplete type 'struct QDebug'
..\..\Qt\2010.04\qt\include/QtCore/../../src/corelib/global/qglobal.h:1632: erro
r: forward declaration of 'struct QDebug'
..\..\Qt\2010.04\qt\include/QtCore/../../src/corelib/global/qglobal.h: At global
 scope:
..\..\Qt\2010.04\qt\include/QtCore/../../src/corelib/global/qglobal.h:1635: warn
ing: inline function 'QDebug qDebug()' used but never defined
mingw32-make[1]: *** [debug/main.o] Error 1
mingw32-make[1]: Leaving directory `c:/Projets/DiskDB'
mingw32-make: *** [debug] Error 2

Et pour information les fichiers du dossier contenant le projet :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 
c:\Projets\DiskDB>dir
 Le volume dans le lecteur C n'a pas de nom.
 Le numéro de série du volume est 240F-B760
 
 Répertoire de c:\Projets\DiskDB
 
26/07/2011  08:34    <REP>          .
26/07/2011  08:34    <REP>          ..
26/07/2011  08:34    <REP>          debug
25/07/2011  08:10             1 199 DiskDB.cbp
25/07/2011  08:10             1 607 DiskDB.layout
26/07/2011  08:35               836 DiskDB.pro
26/07/2011  08:33    <REP>          headers
27/09/2010  23:19            17 436 imageQt.png
26/07/2011  08:35             5 891 Makefile
26/07/2011  08:35             8 072 Makefile.Debug
26/07/2011  08:35             8 230 Makefile.Release
26/07/2011  08:35               237 object_script.DiskDB.Debug
26/07/2011  08:35               257 object_script.DiskDB.Release
26/07/2011  08:34    <REP>          release
26/07/2011  08:33    <REP>          sources
24/07/2011  23:11             3 473 TODO.txt
              10 fichier(s)           47 238 octets
               6 Rép(s)  129 250 426 880 octets libres

Je précise enfin que j'utilie Windows 7 et ma version de Qt doit être 4.6.


Ma question est simple : quelle variable renseignée et comment surtout, pour que ça compile (et linke et tout le bazar) ?

Merci d'avance