2012-02-20 60 views
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爲什麼拒絕構建它。

回答

1

您是否告訴CMake鏈接這些庫?我相信你可以使用「$ {SOLID_LIBS}」var,如下所示:

target_link_libraries(... ${SOLID_LIBS} ...) 
+0

顯然它是需要的$ {KED4_SOLID_LIBS}。我沒有在任何文檔中的任何地方看到這一點 - 你知道它是否在任何地方在線上市? – kemra102 2012-03-03 19:32:05

+0

一些文檔: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

相關問題