2009-09-25 5 views
3

J'ai installé Qt et essayé de construire un projet de modèle (Qt4 Gui Application) dans QtCreator. Je ne peux pas comprendre pourquoi je reçois ces erreurs.Impossible de construire avec Qt sur Snow Leopard

Running build steps for project SourceControl... 
Configuration unchanged, skipping QMake step. 
Starting: /usr/bin/make -w 
make: Entering directory `/Users/jason/SourceControl' 
g++ -c -pipe -g -gdwarf-2 -Wall -W -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Qt4.5/mkspecs/macx-g++ -I. -I/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/usr/include/QtCore -I/Library/Frameworks/QtNetwork.framework/Versions/4/Headers -I/usr/include/QtNetwork -I/Library/Frameworks/QtGui.framework/Versions/4/Headers -I/usr/include/QtGui -I/usr/include -I. -I. -F/Library/Frameworks -o main.o main.cpp 
In file included from /Library/Frameworks/QtCore.framework/Headers/qnamespace.h:45, 
from /Library/Frameworks/QtCore.framework/Headers/qobjectdefs.h:45, 
from /Library/Frameworks/QtCore.framework/Headers/qobject.h:47, 
from /Library/Frameworks/QtCore.framework/Headers/qcoreapplication.h:45, 
from /Library/Frameworks/QtGui.framework/Headers/qapplication.h:45, 
from /Library/Frameworks/QtGui.framework/Headers/QApplication:1, 
from main.cpp:1: 
/Library/Frameworks/QtCore.framework/Headers/qglobal.h:297:34: error: AvailabilityMacros.h: No such file or directory 
In file included from /Library/Frameworks/QtCore.framework/Headers/qstring.h:46, 
from /Library/Frameworks/QtCore.framework/Headers/qobject.h:48, 
from /Library/Frameworks/QtCore.framework/Headers/qcoreapplication.h:45, 
from /Library/Frameworks/QtGui.framework/Headers/qapplication.h:45, 
from /Library/Frameworks/QtGui.framework/Headers/QApplication:1, 
from main.cpp:1: 
/Library/Frameworks/QtCore.framework/Headers/qbytearray.h:48:20: error: string.h: No such file or directory 
In file included from /Library/Frameworks/QtCore.framework/Headers/qobject.h:48, 
from /Library/Frameworks/QtCore.framework/Headers/qcoreapplication.h:45, 
from /Library/Frameworks/QtGui.framework/Headers/qapplication.h:45, 
from /Library/Frameworks/QtGui.framework/Headers/QApplication:1, 
from main.cpp:1: 
/Library/Frameworks/QtCore.framework/Headers/qstring.h:60:22: error: string: No such file or directory 
In file included from /Library/Frameworks/QtCore.framework/Headers/qobject.h:50, 
from /Library/Frameworks/QtCore.framework/Headers/qcoreapplication.h:45, 
from /Library/Frameworks/QtGui.framework/Headers/qapplication.h:45, 
from /Library/Frameworks/QtGui.framework/Headers/QApplication:1, 
from main.cpp:1: 
/Library/Frameworks/QtCore.framework/Headers/qlist.h:50:20: error: iterator: No such file or directory 
/Library/Frameworks/QtCore.framework/Headers/qlist.h:51:16: error: list: No such file or directory 
/Library/Frameworks/QtCore.framework/Headers/qlist.h:54:15: error: new: No such file or directory 
In file included from /Library/Frameworks/QtGui.framework/Headers/qbrush.h:47, 
from /Library/Frameworks/QtGui.framework/Headers/qpalette.h:47, 
from /Library/Frameworks/QtGui.framework/Headers/qwidget.h:48, 
from /Library/Frameworks/QtGui.framework/Headers/qmainwindow.h:45, 
from /Library/Frameworks/QtGui.framework/Headers/QMainWindow:1, 
from mainwindow.h:4, 
from main.cpp:2: 
/Library/Frameworks/QtCore.framework/Headers/qvector.h:52:18: error: vector: No such file or directory 
/Library/Frameworks/QtCore.framework/Headers/qvector.h:54:20: error: stdlib.h: No such file or directory 
In file included from /Library/Frameworks/QtCore.framework/Headers/qstring.h:46, 
from /Library/Frameworks/QtCore.framework/Headers/qobject.h:48, 
from /Library/Frameworks/QtCore.framework/Headers/qcoreapplication.h:45, 
from /Library/Frameworks/QtGui.framework/Headers/qapplication.h:45, 
from /Library/Frameworks/QtGui.framework/Headers/QApplication:1, 
from main.cpp:1: 
/Library/Frameworks/QtCore.framework/Headers/qbytearray.h: In function 'uint qstrlen(const char*)': 
/Library/Frameworks/QtCore.framework/Headers/qbytearray.h:68: error: 'strlen' was not declared in this scope 
/Library/Frameworks/QtCore.framework/Headers/qbytearray.h: In function 'int qstrncmp(const char*, const char*, uint)': 
/Library/Frameworks/QtCore.framework/Headers/qbytearray.h:91: error: 'strncmp' was not declared in this scope 
/Library/Frameworks/QtCore.framework/Headers/qbytearray.h: In function 'bool operator==(const QByteArray&, const QByteArray&)': 
/Library/Frameworks/QtCore.framework/Headers/qbytearray.h:502: error: 'memcmp' was not declared in this scope 
In file included from /Library/Frameworks/QtCore.framework/Headers/qobject.h:48, 
from /Library/Frameworks/QtCore.framework/Headers/qcoreapplication.h:45, 
from /Library/Frameworks/QtGui.framework/Headers/qapplication.h:45, 
from /Library/Frameworks/QtGui.framework/Headers/QApplication:1, 
from main.cpp:1: 
/Library/Frameworks/QtCore.framework/Headers/qstring.h: At global scope: 
/Library/Frameworks/QtCore.framework/Headers/qstring.h:65: error: expected initializer before ' QList::fromStdList()': 
/Library/Frameworks/QtCore.framework/Headers/qlist.h:316: error: 'list' was not declared in this scope 
/Library/Frameworks/QtCore.framework/Headers/qlist.h:316: error: 'back_inserter' is not a member of 'std' 
In file included from /Library/Frameworks/QtGui.framework/Headers/qbrush.h:47, 
from /Library/Frameworks/QtGui.framework/Headers/qpalette.h:47, 
from /Library/Frameworks/QtGui.framework/Headers/qwidget.h:48, 
from /Library/Frameworks/QtGui.framework/Headers/qmainwindow.h:45, 
from /Library/Frameworks/QtGui.framework/Headers/QMainWindow:1, 
from mainwindow.h:4, 
from main.cpp:2: 
/Library/Frameworks/QtCore.framework/Headers/qvector.h: At global scope: 
/Library/Frameworks/QtCore.framework/Headers/qvector.h:293: error: expected unqualified-id before ' QVector::fromStdVector()': 
/Library/Frameworks/QtCore.framework/Headers/qvector.h:294: error: 'vector' was not declared in this scope 
/Library/Frameworks/QtCore.framework/Headers/qvector.h:294: error: 'back_inserter' is not a member of 'std' 
/Library/Frameworks/QtCore.framework/Headers/qvector.h: In constructor 'QVector::QVector(int) [with T = QPoint]': 
/Library/Frameworks/QtGui.framework/Headers/qpolygon.h:93: instantiated from here 
/Library/Frameworks/QtCore.framework/Headers/qvector.h:397: error: no matching function for call to 'operator new(long unsigned int, QPoint*&)' 
:0: note: candidates are: void* operator new(long unsigned int) 
/Library/Frameworks/QtCore.framework/Headers/qvector.h: In constructor 'QVector::QVector(int) [with T = QPointF]': 
/Library/Frameworks/QtGui.framework/Headers/qpolygon.h:152: instantiated from here 
/Library/Frameworks/QtCore.framework/Headers/qvector.h:397: error: no matching function for call to 'operator new(long unsigned int, QPointF*&)' 
:0: note: candidates are: void* operator new(long unsigned int) 
/Library/Frameworks/QtCore.framework/Headers/qlist.h: In member function 'void QList::node_construct(QList::Node*, const T&) [with T = QString]': 
/Library/Frameworks/QtCore.framework/Headers/qlist.h:426: instantiated from 'void QList::append(const T&) [with T = QString]' 
/Library/Frameworks/QtCore.framework/Headers/qstringlist.h:70: instantiated from here 
/Library/Frameworks/QtCore.framework/Headers/qlist.h:341: error: no matching function for call to 'operator new(long unsigned int, QList::Node*&)' 
:0: note: candidates are: void* operator new(long unsigned int) 
/Library/Frameworks/QtCore.framework/Headers/qlist.h: In member function 'void QList::node_copy(QList::Node*, QList::Node*, QList::Node*) [with T = QString]': 
/Library/Frameworks/QtCore.framework/Headers/qlist.h:618: instantiated from 'QList& QList::operator+=(const QList&) [with T = QString]' 
/Library/Frameworks/QtCore.framework/Headers/qstringlist.h:85: instantiated from here 
/Library/Frameworks/QtCore.framework/Headers/qlist.h:360: error: no matching function for call to 'operator new(long unsigned int, QList::Node*)' 
:0: note: candidates are: void* operator new(long unsigned int) 
/Library/Frameworks/QtCore.framework/Headers/qvector.h: In member function 'void QVector::realloc(int, int) [with T = QPoint]': 
/Library/Frameworks/QtCore.framework/Headers/qvector.h:315: instantiated from 'void QVector::detach_helper() [with T = QPoint]' 
/Library/Frameworks/QtCore.framework/Headers/qvector.h:113: instantiated from 'QVector::QVector(const QVector&) [with T = QPoint]' 
/Library/Frameworks/QtGui.framework/Headers/qpolygon.h:66: instantiated from here 
/Library/Frameworks/QtCore.framework/Headers/qvector.h:444: error: no matching function for call to 'operator new(long unsigned int, QPoint*&)' 
:0: note: candidates are: void* operator new(long unsigned int) 
/Library/Frameworks/QtCore.framework/Headers/qvector.h:484: error: no matching function for call to 'operator new(long unsigned int, QPoint*&)' 
:0: note: candidates are: void* operator new(long unsigned int) 
/Library/Frameworks/QtCore.framework/Headers/qvector.h:491: error: no matching function for call to 'operator new(long unsigned int, QPoint*&)' 
:0: note: candidates are: void* operator new(long unsigned int) 
/Library/Frameworks/QtCore.framework/Headers/qvector.h: In member function 'void QVector::realloc(int, int) [with T = QPointF]': 
/Library/Frameworks/QtCore.framework/Headers/qvector.h:315: instantiated from 'void QVector::detach_helper() [with T = QPointF]' 
/Library/Frameworks/QtCore.framework/Headers/qvector.h:113: instantiated from 'QVector::QVector(const QVector&) [with T = QPointF]' 
/Library/Frameworks/QtGui.framework/Headers/qpolygon.h:131: instantiated from here 
/Library/Frameworks/QtCore.framework/Headers/qvector.h:444: error: no matching function for call to 'operator new(long unsigned int, QPointF*&)' 
:0: note: candidates are: void* operator new(long unsigned int) 
/Library/Frameworks/QtCore.framework/Headers/qvector.h:484: error: no matching function for call to 'operator new(long unsigned int, QPointF*&)' 
:0: note: candidates are: void* operator new(long unsigned int) 
/Library/Frameworks/QtCore.framework/Headers/qvector.h:491: error: no matching function for call to 'operator new(long unsigned int, QPointF*&)' 
:0: note: candidates are: void* operator new(long unsigned int) 
/Library/Frameworks/QtCore.framework/Headers/qvector.h: In member function 'void QVector::realloc(int, int) [with T = QPainterPath::Element]': 
/Library/Frameworks/QtCore.framework/Headers/qvector.h:315: instantiated from 'void QVector::detach_helper() [with T = QPainterPath::Element]' 
/Library/Frameworks/QtCore.framework/Headers/qvector.h:129: instantiated from 'void QVector::detach() [with T = QPainterPath::Element]' 
/Library/Frameworks/QtCore.framework/Headers/qvector.h:228: instantiated from 'T* QVector::begin() [with T = QPainterPath::Element]' 
/Library/Frameworks/QtCore.framework/Headers/qvector.h:241: instantiated from 'T& QVector::first() [with T = QPainterPath::Element]' 
/Library/Frameworks/QtGui.framework/Headers/qpainterpath.h:370: instantiated from here 
/Library/Frameworks/QtCore.framework/Headers/qvector.h:444: error: no matching function for call to 'operator new(long unsigned int, QPainterPath::Element*&)' 
:0: note: candidates are: void* operator new(long unsigned int) 
/Library/Frameworks/QtCore.framework/Headers/qvector.h:315: instantiated from 'void QVector::detach_helper() [with T = QPainterPath::Element]' 
/Library/Frameworks/QtCore.framework/Headers/qvector.h:129: instantiated from 'void QVector::detach() [with T = QPainterPath::Element]' 
/Library/Frameworks/QtCore.framework/Headers/qvector.h:228: instantiated from 'T* QVector::begin() [with T = QPainterPath::Element]' 
/Library/Frameworks/QtCore.framework/Headers/qvector.h:241: instantiated from 'T& QVector::first() [with T = QPainterPath::Element]' 
/Library/Frameworks/QtGui.framework/Headers/qpainterpath.h:370: instantiated from here 
/Library/Frameworks/QtCore.framework/Headers/qvector.h:484: error: no matching function for call to 'operator new(long unsigned int, QPainterPath::Element*&)' 
:0: note: candidates are: void* operator new(long unsigned int) 
/Library/Frameworks/QtCore.framework/Headers/qvector.h:491: error: no matching function for call to 'operator new(long unsigned int, QPainterPath::Element*&)' 
:0: note: candidates are: void* operator new(long unsigned int) 
make: *** [main.o] Error 1 
make: Leaving directory `/Users/jason/SourceControl' 
Exited with code 2. 
Error while building project SourceControl 
When executing build step 'Make'

Répondre

3

Je ne suis pas sûr mais je suppose que vous devriez vous concentrer sur la première erreur où il dit qu'il ne peut pas trouver AvailabilityMacros.h. Je pense que cela devrait être dans/usr/include mais je suppose que ce n'est probablement pas le cas puisque votre ligne de compilation montre clairement cela comme l'un des chemins d'inclusion.

Si ce n'est pas là, vous pouvez essayer de savoir où c'est en utilisant find sur la ligne de commande par exemple.

find /usr -name AvailabilityMacros.h 

ou toutes les méthodes GUI sont disponibles sur le Mac (vous pouvez dire que je ne suis pas familier avec Mac OS :)). BTW si la commande find ci-dessus ne donne rien, alors vous pouvez élargir la recherche de /usr à /.


En réponse à votre affichage des résultats: find

Êtes-vous en train de construire votre application contre le MacOSX10.5.sdk? Sinon, je ne pense pas que ce soit la version que vous voulez. Si vous êtes en utilisant le SDK 10.5, vous devez définir la variable qmake QMAKE_MAC_SDK sur /Developer/SDKs/MacOSX10.5.sdk. Vous pouvez le faire dans le fichier de projet ou le définir en tant qu'argument supplémentaire pour qmake dans Projects-> Build steps.

+0

Il n'y a pas de répertoire MacOSX10.6.sdk dans/Developer/SDK sur ma machine. J'espère que le téléchargement de la dernière version de Xcode va résoudre ce problème. – titaniumdecoy

+0

Oui, je pense que ce sera le cas. – Troubadour

+0

Et ... c'est le cas. – titaniumdecoy

0

Merci, Troubadour. Je suis en mesure de résoudre le problème en ajoutant la ligne suivante au fichier .pro de mon projet:

QMAKE_MAC_SDK = /Developer/SDKs/MacOSX10.5.sdk

Je préfère construire contre le SDK Mac OS X 10.6, mais il n'y a pas de répertoire dans/Developer/SDKs. Si vous savez où je peux trouver le SDK 10.6 s'il vous plaît faites le moi savoir. Après la mise à jour vers la dernière version de Xcode, j'ai été capable de supprimer la ligne indiquée ci-dessus du fichier .pro de mon projet et de compiler avec succès.

+0

La définition du chemin d'inclusion n'est pas la meilleure façon d'accéder au SDK. Voir ma réponse éditée pour les détails sur la façon de construire contre un SDK particulier. Je suppose que ce n'est pas ce que vous essayez de faire. Je pense que vous essayez de construire votre application uniquement sur 10.6 lui-même. Est-ce correct? – Troubadour

+0

Je pense que vous l'obtenez de developer.apple.com après que vous vous êtes inscrit pour un compte de développeur. – Troubadour

Questions connexes