QT Compilation

20 views
Skip to first unread message

SAI LAKSHMI BHAVANA

unread,
Jan 17, 2012, 4:36:11 AM1/17/12
to FOSS@ITBHU
I am using ubuntu10.10
i hav installed qt-sdk through synaptic package manager
whan i try to compile a basic helloworld program i am getting error
like
oslbh@ubuntu:~$ qmake-qt4 -project
^C
oslbh@ubuntu:~$ qmake-qt4
oslbh@ubuntu:~$ make
Makefile:6511: warning: overriding commands for target `output.o'
Makefile:2354: warning: ignoring old commands for target `output.o'
Makefile:6799: warning: overriding commands for target `utils.o'
Makefile:3218: warning: ignoring old commands for target `utils.o'
Makefile:6950: warning: overriding commands for target `winfix.o'
Makefile:5094: warning: ignoring old commands for target `winfix.o'
Makefile:7712: warning: overriding commands for target `snprintf.o'
Makefile:5209: warning: ignoring old commands for target `snprintf.o'
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. -
IDownloads/nmap/nbase -IDownloads/nmap -IDownloads/nmap/mswin32 -
IDownloads/nmap/libpcap -IDownloads/nmap/libpcap/pcap -IDownloads/nmap/
mswin32/pcap-include -IDownloads/nmap/nsock/include -IDownloads/nmap/
libnetutil -IDownloads/nmap/libdnet-stripped/include -IDownloads/nmap/
libdnet-stripped/include/dnet -IDownloads/nmap/liblua -IDownloads/nmap/
liblinear -IDownloads/nmap/libpcre -IDownloads/nmap/ncat -IDownloads/
nmap/nping -IDownloads/nmap/libdnet-stripped/src -IDownloads/nmap/
liblinear/blas -IDownloads/nmap/nsock/src -I. -o hello.o hello/
hello.cpp
hello/hello.cpp: In function ‘int main(int, char**)’:
hello/hello.cpp:5:2: error: ‘QApllication’ was not declared in this
scope
hello/hello.cpp:5:15: error: expected ‘;’ before ‘app’
hello/hello.cpp:6:22: error: expected type-specifier before ‘Qlabel’
hello/hello.cpp:6:22: error: cannot convert ‘int*’ to ‘QLabel*’ in
initialization
hello/hello.cpp:6:22: error: expected ‘,’ or ‘;’ before ‘Qlabel’
hello/hello.cpp:7:13: error: statement cannot resolve address of
overloaded function
hello/hello.cpp:8:9: error: ‘app’ was not declared in this scope
hello/hello.cpp: At global scope:
hello/hello.cpp:3:5: warning: unused parameter ‘argc’
hello/hello.cpp:3:5: warning: unused parameter ‘argv’
make: *** [hello.o] Error 1

The code was
#include <QApplication>
#include <QLabel>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLabel *label = new QLabel("Hello Qt!");
label->show();
return app.exec();
}



I am unable to understand what could be the problem

plz help

Rohit Yadav

unread,
Jan 17, 2012, 5:52:36 AM1/17/12
to foss-...@googlegroups.com
Hi,


QApllication should be QApplication
 
hello/hello.cpp:5:15: error: expected ‘;’ before ‘app’
hello/hello.cpp:6:22: error: expected type-specifier before ‘Qlabel’
hello/hello.cpp:6:22: error: cannot convert ‘int*’ to ‘QLabel*’ in
initialization
hello/hello.cpp:6:22: error: expected ‘,’ or ‘;’ before ‘Qlabel’
hello/hello.cpp:7:13: error: statement cannot resolve address of
overloaded function
hello/hello.cpp:8:9: error: ‘app’ was not declared in this scope
hello/hello.cpp: At global scope:
hello/hello.cpp:3:5: warning: unused parameter ‘argc’
hello/hello.cpp:3:5: warning: unused parameter ‘argv’
make: *** [hello.o] Error 1

The code was
#include <QApplication>
#include <QLabel>
int main(int argc, char *argv[])
{
 QApplication app(argc, argv);
 QLabel *label = new QLabel("Hello Qt!");
 label->show();
 return app.exec();
}


Code is fine, try to read the .pro file, qmake -project && make
Let me know if that works... probably upgrade your distro to 11.04/11.10 from 10.3.11.250/ubuntu
 


I am unable to understand what could be the problem

plz help

--
You received this message because you are subscribed to the Google Groups "FOSS@ITBHU" group.
To post to this group, send email to foss-...@googlegroups.com.
To unsubscribe from this group, send email to foss-itbhu+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/foss-itbhu?hl=en.


Reply all
Reply to author
Forward
0 new messages