removido
(usa Nenhuma)
Enviado em 11/08/2014 - 21:22h
gccjava escreveu:
gccjava escreveu:
Como posso compilar algo na biblioteca qt pelo terminal?Seja em C ou C++.
Tentei sudo apt-get install qt5-qmake, mas não retornou nada, qual o repositório que devo adicionar para instalar o qmake?
Estou precisando de ajuda, não quero migrar para o Qt-Sdk ainda, sou inciante..
Resolvido instalei sudo apt-get install libqt4-dev, mas quando complo surge um erro.
#include <qapplication.h>
#include <qlabel.h>
int main(int argc, char* argv)
{
QApplication program(argc,argv);
QLabel *label("Hello World!!!",null);
program.setMainWidget(label);
label.show();
return program.exec();
}
root@debian:/home/brand/Área de trabalho# make
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_WEBKIT -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 projeto.o projeto.cpp
projeto.cpp:4:6: warning: second argument of ‘int main(int, char*)’ should be ‘char **’ [-Wmain]
projeto.cpp: In function ‘int main(int, char*)’:
projeto.cpp:6:33: error: invalid conversion from ‘int’ to ‘Display* {aka _XDisplay*}’ [-fpermissive]
In file included from projeto.cpp:1:0:
/usr/include/qt4/QtGui/qapplication.h:132:5: error: initializing argument 1 of ‘QApplication::QApplication(Display*, Qt::HANDLE, Qt::HANDLE, int)’ [-fpermissive]
projeto.cpp:6:33: error: invalid conversion from ‘char*’ to ‘Qt::HANDLE {aka long unsigned int}’ [-fpermissive]
In file included from projeto.cpp:1:0:
/usr/include/qt4/QtGui/qapplication.h:132:5: error: initializing argument 2 of ‘QApplication::QApplication(Display*, Qt::HANDLE, Qt::HANDLE, int)’ [-fpermissive]
projeto.cpp:8:34: error: ‘null’ was not declared in this scope
projeto.cpp:8:38: error: expression list treated as compound expression in initializer [-fpermissive]
projeto.cpp:10:11: error: ‘class QApplication’ has no member named ‘setMainWidget’
projeto.cpp:12:9: error: request for member ‘show’ in ‘label’, which is of pointer type ‘QLabel*’ (maybe you meant to use ‘->’ ?)
make: ** [projeto.o] Erro 1
root@debian:/home/brand/Área de trabalho#
Como posso resolver isso?