undefined reference to `vtable for KisCropSelection?

Michael Thaler michael.thaler at physik.tu-muenchen.de
Sat Oct 15 18:58:10 CEST 2005


Hello,

I want to refactor the crop tool. I created a new class KisCropSelection:

kis_crop_selection.h:

#ifndef KIS_CROP_SELECTION_H_
#define KIS_CROP_SELECTION_H_

#include <qregion.h>

enum handleType
    {
        None = 0,
        UpperLeft = 1,
        Left = 2,
        LowerLeft = 3,
        Lower = 4,
        LowerRight = 5,
        Right = 6,
        UpperRight = 7,
        Upper = 8
    };

class KisCropSelection
{
    public:
        KisCropSelection(Q_INT32 x, Q_INT32 y, Q_INT32 width, Q_INT32 height, 
Q_UINT32 handleSize=13);
        KisCropSelection(QRect &rect, Q_UINT32 handleSize=13);
        virtual ~KisCropSelection();
    private:
        Q_INT32 m_x, m_y, m_width, m_height;
        Q_INT32 m_handleSize;
        QRegion m_handlesRegion;
};

#endif // KIS_CROP_SELECTION_CROP_H_

kis_crop_selection.cc:

#include <qrect.h>

#include "kis_crop_selection.h"

KisCropSelection::KisCropSelection(Q_INT32 x, Q_INT32 y, Q_INT32 width, 
Q_INT32 height, Q_UINT32 handleSize) : m_x(x), m_y(y), m_width(width), 
m_height(height), m_handleSize(handleSize) {}

KisCropSelection::KisCropSelection(QRect &rect, Q_UINT32 handleSize)
{
    KisCropSelection(rect.x(), rect.y(), rect.width(), rect.height(), 
handleSize);
}

When I try to compile this class, I get the following error:

/bin/sh ../../../libtool --silent --tag=CXX --mode=link g++  -Wno-long-long 
-Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion 
-Wchar-subscripts -Wall -W -Wpointer-arith -g3 -fno-inline -Wformat-security 
-Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions 
-fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST 
-DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -DHAVE_KNEWSTUFF    -o 
kritatoolcrop.la -rpath /usr/local/lib/kde3 -L/usr/lib -L/usr/share/qt3/lib 
-L/usr/X11R6/lib    -module -avoid-version -module -no-undefined 
-Wl,--no-undefined -Wl,--allow-shlib-undefined -R /usr/local/lib -R /usr/lib 
-R /usr/share/qt3/lib -R /usr/X11R6/lib  tool_crop.lo kis_tool_crop.lo 
kis_crop_selection.lo wdg_tool_crop.lo ../../libkritacommon.la
.libs/kis_crop_selection.o: In function `KisCropSelection':
/usr/local/src/kde/koffice/krita/plugins/tool_crop/kis_crop_selection.cc:25: 
undefined reference to `vtable for KisCropSelection'
/usr/local/src/kde/koffice/krita/plugins/tool_crop/kis_crop_selection.cc:25: 
undefined reference to `vtable for KisCropSelection'
/usr/local/src/kde/koffice/krita/plugins/tool_crop/kis_crop_selection.cc:27: 
undefined reference to `vtable for KisCropSelection'
/usr/local/src/kde/koffice/krita/plugins/tool_crop/kis_crop_selection.cc:29: 
undefined reference to `KisCropSelection::~KisCropSelection()'
/usr/local/src/kde/koffice/krita/plugins/tool_crop/kis_crop_selection.cc:27: 
undefined reference to `vtable for KisCropSelection'
/usr/local/src/kde/koffice/krita/plugins/tool_crop/kis_crop_selection.cc:29: 
undefined reference to `KisCropSelection::~KisCropSelection()'
collect2: ld returned 1 exit status

Does somebody understand this? What am I doing wrong here?

Greetings,
Michael


More information about the kimageshop mailing list