[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Problems compiling "Hello World"-App



Hello,

I copied the source of the p2 example from the kde-3.0 developer tutorial a 
file called myapp.cpp.
-------------- myapp.cpp --------------
#include <kapp.h>
#include <klocale.h>
#include <qpushbutton.h>

int main( int argc, char **argv )
{
    KApplication a( argc, argv , "myapp" );

    QPushButton *hello=new QPushButton( i18n("Hello World !"), 0 );
    hello->setAutoResize( TRUE );

    QObject::connect( hello, SIGNAL(clicked()), &a, SLOT(quit()) );

    a.setMainWidget( hello );
    hello->show();

    return a.exec();
}
-----------------------------------------------

Then I tried to compile it with the following two g++ commands:
------------------first-step-----------------
ralf@boron:~/Dokumente/kde_dev/myapp$g++ -I/usr/include/kde -I/usr/include/qt3 
-Wall -g -O2 -c myapp.cpp
-----------------------------------------------
-------------------second-step----------
ralf@boron:~/Dokumente/kde_dev/myapp$ g++  -g -O2  -o myapp  myapp.o  -lqt-mt 
-L/usr/lib -L/usr/lib/qt3 -lpthread
myapp.o: In function `QValueList<QString>::detachInternal(void)':
/usr/include/qt3/include/qvaluelist.h:634: undefined reference to 
`KApplication::KApplication(int &, char **, QCString const &, bool, bool)'
/usr/include/qt3/qvaluelist.h:634: undefined reference to `i18n(char const *)'
/usr/include/qt3/qvaluelist.h:634: undefined reference to 
`KApplication::~KApplication(void)'
/usr/include/qt3/qvaluelist.h:634: undefined reference to 
`KApplication::~KApplication(void)'
collect2: ld returned 1 exit status
-----------------------------------------------

I'm using Debian Woody with kde 3.1.4 and XFree86 4.3
-----------------------------------------------
deb http://download.kde.org/stable/3.1.4/Debian stable main
deb http://people.debian.org/~mmagallo/packages/xfree86/i386/ ./
deb http://people.debian.org/~mmagallo/packages/fontconfig/i386/ ./
deb http://people.debian.org/~mmagallo/packages/freetype/i386/ ./
deb http://people.debian.org/~mmagallo/packages/xft/i386/ ./
deb http://people.debian.org/~mmagallo/packages/libpng/i386/ ./
deb http://people.debian.org/~mmagallo/packages/debconf/i386/ ./
-----------------------------------------------
Nearly everything fine with that but broken dependency on xlibs-pic from 
kdelibs4-dev(which seems not to be available for 4.3.
I just used "dpkg -x kdelibs4-dev... /" to force to unpack it.

Now the obvious question: What have I done wrong? Any similar Experiences?
If this is not the right question for this list... please don't only blame 
me.. be so kind and name the right one to me (if you know one).

Thanks a lot!

Kind regards,
Ralf



Reply to: