c++ with Qt compilation error

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
kayoKasee
Posts: 3
Joined: Fri 04 Jun 2010, 07:24

c++ with Qt compilation error

#1 Post by kayoKasee »

hi guys, has anyone compiled a c++ file with Qt?
I got this error:
'cannot find -lQtGui'
after issuing the 'make' command in the console.
I don't whats this error or do i need additional libraries?
My laptop runs in puppy 4.3.1 with devx.sfs.
I'm a noob in c++ gui and almost using linux distros for 3 months. Really need help.
I have no problems compiling with GTK+. I'm just using Qt because a lot of people recommends it.

muggins
Posts: 6724
Joined: Fri 20 Jan 2006, 10:44
Location: hobart

#2 Post by muggins »

Can you mention which program you're trying to compile? Generally, to compile Qt4 programs, you need to install qt4-4.3.2.pet, however you'll often find that newer Qt4 applications will need a newer Qt4 version.

kayoKasee
Posts: 3
Joined: Fri 04 Jun 2010, 07:24

qt4 program

#3 Post by kayoKasee »

muggins wrote: Can you mention which program you're trying to compile?
Here's what i'm compiling:(copied from trolltech's tutorials)
#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();
}
Generally, to compile Qt4 programs, you need to install qt4-4.3.2.pet
Yeh? I thought everything I need is in the devx.sfs file, like the gtkmm. I'll recompile my program again with the additional pet file.
Thanks!

kayoKasee
Posts: 3
Joined: Fri 04 Jun 2010, 07:24

Re: qt4 program

#4 Post by kayoKasee »

Thanks muggins, but same thing happened after I recompiled my program even with qt4-4.3.2.pet installed.
Here's what the error says with the 'make' command:

g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/opt/qt4/mkspecs/linux-g++ -I. -I/opt/qt4/include/QtCore -I/opt/qt4/include/QtCore -I/opt/qt4/include/QtGui -I/opt/qt4/include/QtGui -I/opt/qt4/include -I. -I. -I. -o qt1.o qt1.cc
qt1.cc:13:2: warning: no newline at end of file
g++ -Wl,-rpath,/opt/qt4/lib -o Qt qt1.o -L//opt/qt4/lib -lQtGui -L//opt/qt4/lib -L/usr/X11R6/lib -lpng -lSM -lICE -pthread -L/opt/gnome2/lib -pthread -lXrender -lXrandr -lXfixes -lXcursor -lfreetype -lfontconfig -lXext -lX11 -lQtCore -lz -lm -pthread -lgthread-2.0 -lrt -lglib-2.0 -ldl -lpthread
/usr/lib/gcc/i486-t2-linux-gnu/4.2.2/../../../../i486-t2-linux-gnu/bin/ld: cannot find -lQtGui
collect2: ld returned 1 exit status
make: *** [Qt] Error 1

Where 'Qt' is my project name and 'qt1.cc' is my main file.
could someone who have compiled there Qt apps properly tell me what's wrong? I'm using puppy431 with the equivalent devx.sfs file.

Post Reply