Prosze... pomocy!!! Meczylem sie z tym juz pol roku temu i nic nie zdzialalem... odposcilem...
Teraz jednak chcialbym cos zrobic w Qt... i nie moge.... Zeby polec na takiej glupocie ??
Knoppix 5.0.1
Sciagnalem plik qt-x11-opensource-src-4.1.4.tar.gz
przenioslem do /usr/local i rozpakowalem
zmienilem nazwe ostatniego katalogu tak ze wszystko znajduje sie w /usr/local/qt
w powloce wszedlem do /usr/local/qt i zrobilem po
./configure
make
make install
zeszlo pol dnia
Utworzyl sie nowy katalog /usr/local/Trolltech/Qt-4.1.4
w /etc/profile dopisalem NA POCZATKU (nie wiem czy to wazne) pliku takie linijki
QTDIR=/usr/local/Trolltech/Qt-4.1.4
PATH=$QTDIR/bin:$PATH
if [ $MANPATH ]
then
MANPATH=$QTDIR/man:$MANPATH
else
MANPATH=$QTDIR/man
fi
if [ $LD_LIBRARY_PATH ]
then
LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
else
LD_LIBRARY_PATH=$QTDIR/lib
fi
LIBRARY_PATH=$LD_LIBRARY_PATH
if [ $CPLUS_INCLUDE_PATH ]
then
CPLUS_INCLUDE_PATH=$QTDIR/include:$CPLUS_INCLUDE_PATH
else
CPLUS_INCLUDE_PATH=$QTDIR/include
fiexport QTDIR PATH MANPATH LD_LIBRARY_PATH LIBRARY_PATH
export CPLUS_INCLUDE_PATH
Pisali zeby napisac
QTDIR=/usr/local/qt a nie tak jak ja zrobilem ale czy bylby sens podawac sciezke do plikow ze zrodlami?
Zainstalowalem jeszcze qt-devel w wersji 4.1.4.
Probuje na takim kodzie
#include <QtGui/QApplication>
#include <QtGui/QWidget>
#include <QtGui/QPushButton>
int main (int argc, char **argv)
{
QApplication a( argc, argv);
QWidget mainwindow;
mainwindow.setMinimumSize( 200, 100);
mainwindow.setMaximumSize (200, 100);
QPushButton helloworld("Czesc", &mainwindow);
helloworld.setGeometry(20, 20, 160, 60);
mainwindow.show();
return a.exec();
}
Robie później
qmake -project
qmake
make
Po qmake -project nic sie nie stalo.
Po qmake kilkadziesiat razy wypisal
QFile::open: No file name specified
QFile::open: No file name specified
a pozniej wiele razy to
qt_config.prf:8: Unknown test function: debug
Error processing project file:
QFile::open: No file name specified
QFile::open: No file name specified
qt_config.prf:8: Unknown test function: debug
Error processing project file:
QFile::open: No file name specified
QFile::open: No file name specified
qt_config.prf:8: Unknown test function: debug
Po make bylo to
g++ -o kodzik kodzik.o -L/usr/X11R6/lib -lXext -lX11 -lm
kodzik.o: In functionmain': kodzik.cpp:(.text+0x27): undefined reference to
QApplication::QApplication(int&, char**)'
kodzik.cpp:(.text+0x43): undefined reference toQWidget::QWidget(QWidget*, QFlags<Qt::WindowType>)' kodzik.cpp:(.text+0x5d): undefined reference to
QWidget::setMinimumSize(int, int)'
kodzik.cpp:(.text+0x77): undefined reference toQWidget::setMaximumSize(int, int)' kodzik.cpp:(.text+0x7e): undefined reference to
QString::shared_null'
kodzik.cpp:(.text+0x85): undefined reference toQString::shared_null' kodzik.cpp:(.text+0xa5): undefined reference to
QString::fromAscii(char const*, int)'
kodzik.cpp:(.text+0xb7): undefined reference toQString::operator=(QString const&)' kodzik.cpp:(.text+0xcf): undefined reference to
QString::free(QString::Data*)'
kodzik.cpp:(.text+0xe2): undefined reference toQPushButton::QPushButton(QString const&, QWidget*)' kodzik.cpp:(.text+0xfa): undefined reference to
QString::free(QString::Data*)'
kodzik.cpp:(.text+0x125): undefined reference toQWidget::setGeometry(QRect const&)' kodzik.cpp:(.text+0x136): undefined reference to
QWidget::setVisible(bool)'
kodzik.cpp:(.text+0x13b): undefined reference toQApplication::exec()' kodzik.cpp:(.text+0x145): undefined reference to
QPushButton::~QPushButton()'
kodzik.cpp:(.text+0x14d): undefined reference toQWidget::~QWidget()' kodzik.cpp:(.text+0x158): undefined reference to
QApplication::~QApplication()'
kodzik.cpp:(.text+0x16f): undefined reference toQApplication::~QApplication()' kodzik.cpp:(.text+0x181): undefined reference to
QPushButton::~QPushButton()'
kodzik.cpp:(.text+0x189): undefined reference toQWidget::~QWidget()' kodzik.cpp:(.text+0x1a5): undefined reference to
QString::free(QString::Data*)'
kodzik.cpp:(.text+0x1c1): undefined reference to `QString::free(QString::Data*)'
collect2: ld returned 1 exit status
make: *** [kodzik] Error 1
Jest już tak blisko....:( proszę pomóżcie.