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

KXMLGUIClient::setXMLFile: cannot find .rc file [solved]

Tags: None
(comma "," separated)
keba
Registered Member
Posts
10
Karma
1
Hi,

I'm totally new to GUI programming. These are my first steps. Anyway, I installed Kdevelop 4.0.1 (on Gentoo) and I started to follow the tutorials on techbase. When I got to the KXMLGUI part, I couldn't get the Toolbar to work:
Code: Select all
test(6126) KXMLGUIClient::setXMLFile: cannot find .rc file "testui.rc" for component "test"

I even tried installing the project, but that didn't help either. So now I''m stuck. Do you have any idea how I could get this to work? Thanks.

Last edited by keba on Tue Aug 03, 2010 7:03 am, edited 1 time in total.
User avatar
anda_skoa
KDE Developer
Posts
783
Karma
4
OS
It could be a matter of search paths, e.g. the prefix you are installing to not being one KDE uses to search for resources.

Check the output of
Code: Select all
kde4-config --path data


In the shell you are running your program from.

Cheers,
_


anda_skoa, proud to be a member of KDE forums since 2008-Oct.
keba
Registered Member
Posts
10
Karma
1
Thanks, you're right. I get
Code: Select all
/home/me/.kde4/share/apps/:/usr/share/apps/

So since I'm still developing testing this stuff, I just made a link into /home/me/.kde4/share/apps/ to where the *ui.rc file is actually located. This way, everything works totally fine:
Code: Select all
ln -sf /home/me/projects/test/src /home/me/.kde4/share/apps/test
pinotree
KDE Developer
Posts
222
Karma
7
OS
XMLGUI requires the ui.rc files in "installed" paths, be it the KDE system prefixes or the ~/.kde(4). Running an uninstalled XMLGUI application without already "installed" ui.rc file will not work.


Pino Toscano
keba
Registered Member
Posts
10
Karma
1
That explains it. Although this also means that I'll have to check the installation process since it didn't work even after installing my "test" app... Anyway, thanks
Tupla
Registered Member
Posts
47
Karma
0
OS
You must have in your CMakeLists.txt something like
Code: Select all
install(FILES testui.rc DESTINATION ${DATA_INSTALL_DIR}/appname)
keba
Registered Member
Posts
10
Karma
1
This line was in there, but it seems that the files don't get installed in the correct kde4 path, which for me is /usr, because the variable isn't set correctly. This is a problem with my distro settings though...
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
When running cmake, you need to pass the following argument: -DCMAKE_INSTALL_PREFIX=/usr


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
keba
Registered Member
Posts
10
Karma
1
Oh. Thanks a lot. I'm sorry for these stupid questions, I'm really new to all of this.
User avatar
anda_skoa
KDE Developer
Posts
783
Karma
4
OS
While this is technically correct, I would recommend not never ever install into the prefix used by the system itself.

By default CMake will install into prefix /usr/local, which is much more preferable for locally build or otherwise locally installed software.

For development it is also often useful to install into a totally different prefix, as it allows to remove the files installed during development by just removing the whole prefix.

The actual problem here, which we can already see in th second reply, is that the installation prefix used is not part of KDE's search path.
So instead of working around that by installing into one that is, it is far more useful to just extend the search path list so KDE also looks in the prefix the software is installed to.

KDE has environment variables for this, e.g. KDEDIRS, and ways to even set that for the whole KDE session.

Say, for example, that /usr/local is not yet in the search path and software should be installed there.

1) create a file (name doesn't matter, has to have the .sh extension though) which extends the variable
Code: Select all
KDEDIRS=$KDEDIRS:/usr/local
export KDEDIRS


2) put it into one of KDE's environment extender directories, e.g. for one user only
Code: Select all
$HOME/.kde/env


Cheers,
_


anda_skoa, proud to be a member of KDE forums since 2008-Oct.


Bookmarks



Who is online

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