Jump to content

Installing Qt4


Recommended Posts

Well when i put /usr/lib/qt4 as QTDIR; qt4 and qt3 do not compile

when i set QTDIR to /usr/lib/qt3 only qt3 compiles

and my PATH does include /usr/local/Trolltech/Qt-4.3.3/bin

/usr/lib/qt3 etc..... shows up three times in my PATH var,

and i don't know y

Help

Link to comment
Share on other sites

Well when i put /usr/lib/qt4 as QTDIR; qt4 and qt3 do not compile

You don't/shouldn't have a /usr/lib/qt4, unless you have installed something from the repos. Because you chose to use the default install with ./configure.

For now you can simply do

PATH=$PATH:/usr/local/Trolltech/Qt-4.3.3/bin

then do

echo $PATH

to see what you have.

Then do

export QTDIR=/usr/local/Trolltech/Qt-4.3.3

then do

echo $QTDIR

to check that. If everything looks good, using the same terminal session, go to work with qt4.

It would make it easier for you if you renamed the Qt-4.3.3 directory to qt4.

 

I wouldn't suggest placing the 'export QTDIR' in your bash_profile, because it 'may' screw up your KDE desktop, however I'm not positive about this.

Link to comment
Share on other sites

Greg2:

 

After setting up my env vars to this

PATH=$PATH:/usr/local/Trolltech/Qt-4.3.3/bin

export QTDIR=/usr/local/Trolltech/Qt-4.3.3

and in checking them they show up, fine

 

 

when i try to compile this source code with

qmake -project

qmake

make

//////////////////////////

#include <QApplication>

#include <QPushButton>

 

int main(int argc, char *argv[])

{

QApplication app(argc, argv);

 

QPushButton hello("Hello World");

hello.resize(100, 30);

hello.show();

return app.exec();

}

///////////////////////////

 

it get this error:

 

g++ -c -pipe -Wall -W -O2 -DQT_NO_DEBUG -I/usr/lib/qt3/mkspecs/default -I. -I. -I/usr/local/Trolltech/Qt-4.3.3/include -o FIRST.o FIRST.cpp

cc1plus: error: /usr/local/Trolltech/Qt-4.3.3/include: Permission denied

make: *** [FIRST.o] Error 1

 

so i tried changing owner and group on /usr/local/Trolltech/Qt-4.3.3/include

and /usr/local/Trolltech

and /usr/local/Trolltech/Qt-4.3.3

to "mylogin name"

because they all have (owner = root) (group = root) on those as well"

and try to recompile i get this

 

g++ -c -pipe -Wall -W -O2 -DQT_NO_DEBUG -I/usr/lib/qt3/mkspecs/default -I. -I. -I/usr/local/Trolltech/Qt-4.3.3/include -o FIRST.o FIRST.cpp

FIRST.cpp:1:24: error: QApplication: No such file or directory

FIRST.cpp:2:23: error: QPushButton: No such file or directory

FIRST.cpp: In function ‘int main(int, char**)’:

FIRST.cpp:6: error: ‘QApplication’ was not declared in this scope

FIRST.cpp:6: error: expected `;' before ‘app’

FIRST.cpp:8: error: ‘QPushButton’ was not declared in this scope

FIRST.cpp:8: error: expected `;' before ‘hello’

FIRST.cpp:9: error: ‘hello’ was not declared in this scope

FIRST.cpp:11: error: ‘app’ was not declared in this scope

FIRST.cpp: At global scope:

FIRST.cpp:4: warning: unused parameter ‘argc’

FIRST.cpp:4: warning: unused parameter ‘argv’

make: *** [FIRST.o] Error 1

Edited by grimx
Link to comment
Share on other sites

it get this error:

 

g++ -c -pipe -Wall -W -O2 -DQT_NO_DEBUG -I/usr/lib/qt3/mkspecs/default

You are tying to use qt3/mkspecs/default/(qt/qmake.conf-3.3.8), and it 'will not work' with qt4.

 

I would suggest that you check out the Trolltech/Qt tutorials and their forums for more info on this. I'm very sorry, but I do not have the time or skill to try to teach Qt programming here... I still use their documentation for my needs. :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...