I am trying to build some KDE software I am writing in KDevelop but am getting these errors:
CMakeFiles/kquickformat.dir/deviceinfo.o: In function `QList<Solid::Device>::node_destruct(QList<Solid::Device>::Node*, QList<Solid::Device>::Node*)':
/usr/include/QtCore/qlist.h:418: undefined reference to `Solid::Device::~Device()'
CMakeFiles/kquickformat.dir/deviceinfo.o: In function `DeviceInfo':
/home/kemra102/projects/KDE/kquickformat/src/deviceinfo.cpp:5: undefined reference to `Solid::DeviceNotifier::instance()'
/home/kemra102/projects/KDE/kquickformat/src/deviceinfo.cpp:7: undefined reference to `Solid::Device::listFromType(Solid::DeviceInterface::Type const&, QString const&)'
CMakeFiles/kquickformat.dir/deviceinfo.o: In function `DeviceNotifier':
/usr/include/KDE/Solid/../../solid/devicenotifier.h:42: undefined reference to `vtable for Solid::DeviceNotifier'
CMakeFiles/kquickformat.dir/deviceinfo.o: In function `~DeviceNotifier':
/usr/include/KDE/Solid/../../solid/devicenotifier.h:42: undefined reference to `vtable for Solid::DeviceNotifier'
The relevant code is as follows:
#include "deviceinfo.h"
DeviceInfo::DeviceInfo(Solid::DeviceNotifier *parent)
{
Solid::DeviceNotifier *notifier = Solid::DeviceNotifier::instance();
QList<Solid::Device> list = Solid::Device::listFromType(Solid::DeviceInterface::StorageDrive, QString());
}
and
#ifndef DEVICEINFO_H
#define DEVICEINFO_H
#include <QList>
#include <QString>
#include <Solid/Device>
#include <Solid/DeviceNotifier>
#include <Solid/StorageDrive>
class DeviceInfo : public Solid::DeviceNotifier
{
public:
private:
DeviceInfo(Solid::DeviceNotifier *parent=0);
Solid::DeviceNotifier* notifier;
QList<Solid::Device> list;
};
#endif
I definitely have the libraries installed and can see them on my file system, so I cannot understand why Kdevelop refuses to build it.
Did you tell CMake to link those libraries? I believe you can use the “${SOLID_LIBS}” var, like so: