This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Nepomuk tag to file adding error

Tags: None
(comma "," separated)
User avatar
b0noI
Registered Member
Posts
4
Karma
0
OS

Nepomuk tag to file adding error

Mon Aug 30, 2010 1:57 pm
Using example from api.kde.org :
Code: Select all
Nepomuk::Tag tag( "MyTag" );
Nepomuk::File f( "/home/foo/bar.txt" );
f.addTag( tag );


return me this problem:

error: ‘File’ is not a member of ‘Nepomuk’


I have inculde to my project this files:

Code: Select all
#include <nepomuk/tag.h>
#include <nepomuk/resource.h>
#include <nepomuk/resourcemanager.h>
#include <nepomuk/nepomuk_export.h>


Searching for property Nepomuk::File in all files at folder include/nepomuk give no answer(.

After this error i`ve tried another example:
Code: Select all
Nepomuk::ResourceManager::instance()->init();
    Nepomuk::Resource f("/home/b0noi/tmp/1");


But this way a get the next error:

error: undefined reference to `Nepomuk::ResourceManager::instance()'


I just need simple example to add meta tag to file, this need me at some interesting project, wich will made process of tag adding automate.

I`am using:
KDE 4.4.2
Kubuntu 10.04.1
QT 4.6
Qt Creator 2.0.0

P.S.: sorry about my English and low exp at KDE-dev, all my and my team have only exp at QT-devNepomuk tag to file adding error
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
You need to add #include <nepomuk/file.h> to your list of includes.
You also need to adjust your build system to link to libnepomuk.so.

If you are using CMake this can be accomplished by adding ${NEPOMUK_LIBRARIES} to your target_link_libraries statement in CMakeLists.txt assuming you already have find_package(KDE REQUIRED) in CMakeLists.txt


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: Bing [Bot], blue_bullet, Google [Bot], rockscient, Yahoo [Bot]