0
我試圖建立一些KDE軟件我在KDevelop的寫作,但我得到這些錯誤:KD應用不建,未定義全球化志願服務青年到Solid庫
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'
相關的代碼如下:
#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());
}
和
#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
我肯定已經安裝了庫,可以看到他們我的文件系統上,所以我不能理解Kdevelop爲什麼拒絕構建它。
顯然它是需要的$ {KED4_SOLID_LIBS}。我沒有在任何文檔中的任何地方看到這一點 - 你知道它是否在任何地方在線上市? – kemra102 2012-03-03 19:32:05
一些文檔:http://www.vtk.org/Wiki/CMake:How_To_Find_Libraries#How_package_finding_works 正確地說,您的CMake構建系統應該可以完整地執行find_package/if(FOUND)/ Libs/Inc Dirs。 – OliJG 2012-03-03 22:25:39