LINUX.ORG.RU

Подскажите чего не хватает линкеру для счастья


0

0

#g++ -Wl,-rpath,/usr/local/Trolltech/Qt-4.4.0/lib -o izum accounting.o connect.o conwindow.o debug.o kpppwidget.o main.o modem.o opener.o pppdata.o ppplog.o pppstatdlg.o pppstats.o providerdb.o pwentry.o requester.o ruleset.o runtests.o utils.o kapplication.o moc_kconfig.o moc_kmessagebox.o -L/usr/local/Trolltech/Qt-4.4.0/lib -lQtGui -L/usr/local/Trolltech/Qt-4.4.0/lib -L/usr/X11R6/lib -lSM -lICE -pthread -pthread -lXi -lXrender -lXrandr -lfreetype -lfontconfig -lXext -lX11 -lQtCore -lm -pthread -lgthread-2.0 -lrt -lpthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0
pppdata.o: In function `KApplication::kApplication()':
/root/projects.izum/kppp/izum/kde/kapplication.h:19: undefined reference to `KApplication::KApp'
kapplication.o: In function `KApplication::config()':
/root/projects.izum/kppp/izum/kde/kapplication.cpp:18: undefined reference to `KApplication::config_p'
kapplication.o: In function `~KApplication':
/root/projects.izum/kppp/izum/kde/kapplication.cpp:12: undefined reference to `KApplication::config_p'
/root/projects.izum/kppp/izum/kde/kapplication.cpp:12: undefined reference to `KApplication::config_p'
/root/projects.izum/kppp/izum/kde/kapplication.cpp:12: undefined reference to `KApplication::config_p'
/root/projects.izum/kppp/izum/kde/kapplication.cpp:13: undefined reference to `KApplication::KApp'
/root/projects.izum/kppp/izum/kde/kapplication.cpp:12: undefined reference to `KApplication::config_p'
/root/projects.izum/kppp/izum/kde/kapplication.cpp:12: undefined reference to `KApplication::config_p'
/root/projects.izum/kppp/izum/kde/kapplication.cpp:12: undefined reference to `KApplication::config_p'
/root/projects.izum/kppp/izum/kde/kapplication.cpp:13: undefined reference to `KApplication::KApp'
/root/projects.izum/kppp/izum/kde/kapplication.cpp:12: undefined reference to `KApplication::config_p'
/root/projects.izum/kppp/izum/kde/kapplication.cpp:12: undefined reference to `KApplication::config_p'
/root/projects.izum/kppp/izum/kde/kapplication.cpp:12: undefined reference to `KApplication::config_p'
/root/projects.izum/kppp/izum/kde/kapplication.cpp:13: undefined reference to `KApplication::KApp'
kapplication.o: In function `KApplication':
/root/projects.izum/kppp/izum/kde/kapplication.cpp:7: undefined reference to `KApplication::config_p'
/root/projects.izum/kppp/izum/kde/kapplication.cpp:8: undefined reference to `KApplication::KApp'
/root/projects.izum/kppp/izum/kde/kapplication.cpp:7: undefined reference to `KApplication::config_p'
/root/projects.izum/kppp/izum/kde/kapplication.cpp:8: undefined reference to `KApplication::KApp'
collect2: выполнение ld завершилось с кодом возврата 1
make: *** [izum] Ошибка 1
Чтв 27 Ноя 03:24:46|root@cvv:#cat kde/kapplication.h
#ifndef KAPPLICATION_H
#define KAPPLICATION_H

#include <qapplication.h>

#include <kconfig.h>

#define kapp KApplication::kApplication()

class KApplication : public QApplication
{
Q_OBJECT

public:
KApplication( int n=0, char*argv[]=0);
~KApplication();

KConfig* config (void);
static KApplication* kApplication() { return KApp; }
QString name (void);
//private:
static KConfig* config_p;
static KApplication *KApp;
};

#endif
#Чтв 27 Ноя 03:36:56|root@cvv:izum#

anonymous

Чтв 27 Ноя 03:36:56|root@cvv:izum# cat kde/kapplication.cpp #include <kapplication.h>

KApplication::KApplication ( int n, char*argv[] ) : QApplication(n, argv) { config_p = new KConfig(); KApp = this; }; KApplication::~KApplication() { delete config_p; KApp = 0; };

KConfig* KApplication::config (void) { return config_p; }; QString KApplication::name() { return applicationName(); };

#include "moc_kapplication.cpp" Чтв 27 Ноя 03:37:12|root@cvv:izum#

anonymous
()

Чтв 27 Ноя 03:36:56|root@cvv:izum# cat kde/kapplication.cpp
#include <kapplication.h>


KApplication::KApplication ( int n, char*argv[] )
    : QApplication(n, argv)
{
    config_p = new KConfig();
    KApp = this;
};
KApplication::~KApplication()
{
    delete config_p;
    KApp = 0;
};

KConfig* KApplication::config (void)
{
    return config_p;
};
QString KApplication::name()
{
    return applicationName();
};

#include "moc_kapplication.cpp"
Чтв 27 Ноя 03:37:12|root@cvv:izum#

anonymous
()
Ответ на: комментарий от anonymous

Ща спою... Мелкие советы.

// .h
class KApplication : public QApplication
{
Q_OBJECT

public:
KApplication( int n=0, char*argv[]=0);
~KApplication();

KConfig* config (void) const; // <<== here
static KApplication* kApplication() { return KApp; }
QString name (void) const; // <<== here
//private:
static KConfig* config_p;
static KApplication *KApp;
};

// .cpp
KApplication::KApplication ( int n, char*argv[] )
    : QApplication(n, argv)
{
    Q_ASSERT(!KApp); // <<== here
    config_p = new KConfig();
    KApp = this;
};

Dendy ★★★★★
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.