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.
c++ with Qt compilation error
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.
qt4 program
Here's what i'm compiling:(copied from trolltech's tutorials)muggins wrote: Can you mention which program you're trying to compile?
#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();
}
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.Generally, to compile Qt4 programs, you need to install qt4-4.3.2.pet
Thanks!
Re: qt4 program
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.
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.