Results 1 to 10 of 10
I am new to GUI programming, while surfing through trolltech i find this tutorial. I tried several ways but couln't make it run. can somebody help please ???
Here is ...
- 12-14-2009 #1Just Joined!
- Join Date
- Dec 2009
- Location
- Rajshahi || Dhaka, Bangladesh
- Posts
- 11
QT3 Problem
I am new to GUI programming, while surfing through trolltech i find this tutorial. I tried several ways but couln't make it run. can somebody help please ???
Here is the code :
Code:/* A small program to demonstrate QT FileName : main.cpp */ #include <qapplication.h> #include <qpushbutton.h> int main(int argc, char *argv[]) { QApplication app(argc, argv) ; //application created QPushButton button1("hello world", 0) ; //button created params - caption, parent 0 for no parent button1.resize(100, 30) ; //resize params - width, height app.setMainWidget(&button1) ; //not necessary but every application should have a main widget button1.show() ; return app.exec() ; }
then i do the following
qmake -project
qmake
make
chmod +x main.o
./main.o
the out come is this : "bash: ./main.o: cannot execute binary file"
- 12-15-2009 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
main.o is just one of the binary files that make up your executable - it is NOT in itself an executable. The actual executable is either named a.out, or simply main. If the make files did not result in an executable, then you need to link the .o files with the appropriate libraries, such as qt, and create one.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 12-15-2009 #3Just Joined!
- Join Date
- Dec 2009
- Location
- Rajshahi || Dhaka, Bangladesh
- Posts
- 11
Thanx man. You r right. main.o is just a binary file. The thing that runs is another file named after me...! Now how weird is that ??? Do you have any explaination ???
- 12-15-2009 #4
qmake -project names the project with the name of the directory it is in. So I suppose you had this file and you were running qmake in your home directory, which was named after you so the project was named after you and therefore the program itself was named after you.
- 12-15-2009 #5Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
Of course it's kind of silly to have a program named "dumb_terminal"...
ROFL
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 12-16-2009 #6Just Joined!
- Join Date
- Dec 2009
- Location
- Rajshahi || Dhaka, Bangladesh
- Posts
- 11
- 12-16-2009 #7Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
Of course, there are times when I think about chaning my handle to "dim_bulb"...
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 12-16-2009 #8Just Joined!
- Join Date
- Dec 2009
- Location
- Rajshahi || Dhaka, Bangladesh
- Posts
- 11
- 12-16-2009 #9
- 12-16-2009 #10Just Joined!
- Join Date
- Dec 2009
- Location
- Rajshahi || Dhaka, Bangladesh
- Posts
- 11


Reply With Quote
