Saturday, July 5th 2008, 12:27pm UTC+1

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

R.M

Beginner

1

Saturday, February 23rd 2008, 1:47pm

problem in compiling qt program

Hello every one ,,

I'm bignner in linux and qt ,,
I have a problem when I try to compile my first program using qt ;(

I use qt3 and the version of qmake is : 1.07a (Qt 3.3.7)

after running make comand the output is :

Source code

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
/usr/share/qt3/bin/uic hello.ui -o .ui/hello.h
Session management error: Authentication Rejected, reason : None of the authentication protocols specified are supported and host-based authentication failed
g++ -c -pipe -Wall -W -O2 -D_REENTRANT  -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -I/usr/share/qt3/mkspecs/default -I. -I/usr/share/qt3/include -I.ui/ -I. -I.moc/ -o .obj/main.o main.cpp
main.cpp:1:26: error: qapplication.h: No such file or directory
In file included from main.cpp:2:
.ui/hello.h:13:22: error: qvariant.h: No such file or directory
.ui/hello.h:14:21: error: qdialog.h: No such file or directory
.ui/hello.h:23: error: expected class-name before ‘{’ token
.ui/hello.h:24: error: ISO C++ forbids declaration of ‘Q_OBJECT’ with no type
.ui/hello.h:26: error: expected ‘;’ before ‘public’
.ui/hello.h:34: error: expected `:' before ‘slots’
.ui/hello.h:35: error: expected primary-expression before ‘virtual’
.ui/hello.h:35: error: ISO C++ forbids declaration of ‘slots’ with no type
.ui/hello.h:35: error: expected ‘;’ before ‘virtual’
main.cpp: In function ‘int main(int, char**)’:
main.cpp:6: error: ‘QApplication’ was not declared in this scope
main.cpp:6: error: expected `;' before ‘a’
.ui/hello.h:28: error: ‘hello::~hello()’ is private
main.cpp:7: error: within this context
main.cpp:8: error: ‘class hello’ has no member named ‘show’
main.cpp:9: error: ‘a’ was not declared in this scope
main.cpp:9: error: ‘lastWindowClosed’ was not declared in this scope
main.cpp:9: error: ‘SIGNAL’ was not declared in this scope
main.cpp:9: error: ‘quit’ was not declared in this scope
main.cpp:9: error: ‘SLOT’ was not declared in this scope
main.cpp: At global scope:
main.cpp:4: warning: unused parameter ‘argc’
main.cpp:4: warning: unused parameter ‘argv’
make: *** [.obj/main.o] Error 1




and here is the code of main.cpp

Source code

1
2
3
4
5
6
7
8
9
10
11
#include <qapplication.h>
#include "hello.h"

int main( int argc, char ** argv )
{
    QApplication a( argc, argv );
    hello w;
    w.show();
    a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
    return a.exec();
}


could you please help me :( :(

Any help is greatly appreciated

This post has been edited 5 times, last edit by "R.M" (Feb 23rd 2008, 1:49pm)

  • Go to the top of the page

nijish

Trainee

Posts: 154

Location: Bangalore

Occupation: Software Engineer

2

Saturday, February 23rd 2008, 1:56pm

seems like the qt libraries are not added appropriately to your include list in configure....
  • Go to the top of the page

R.M

Beginner

3

Saturday, February 23rd 2008, 1:58pm

Thanks so much nijish ,,
could you plesas tell me how to fix this problem :(
  • Go to the top of the page

nijish

Trainee

Posts: 154

Location: Bangalore

Occupation: Software Engineer

4

Saturday, February 23rd 2008, 2:01pm

i meant that you will have to re- ./configure!
do it with the proper --qt-dir, --qt-include, --qt-libraries, etc..

do --help and check out. sorry but i dont have a linux m/c rite now..
  • Go to the top of the page

macabre13

Trainee

Posts: 127

Location: Poland/ Wroclaw

Occupation: sw developer

5

Friday, March 14th 2008, 11:47am

Is there a way to add those path into "qt-configure-file" (whatever) manually without re ./configure?
- ebm - noise - industrial -
I always could be wrong.
Lets share knowledge!
  • Go to the top of the page

6

Monday, March 17th 2008, 9:54am

RE: problem in compiling qt program

Please view how to compile gcc and install.
install mingw
  • Go to the top of the page

Rate this thread