<div dir="ltr"><br><br><div class="gmail_quote">On Thu, Aug 7, 2008 at 11:23 AM, Dorian Perkins <span dir="ltr"><<a href="mailto:dperkins@google.com">dperkins@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr">Hi again,<br><br>So I am attempting to compile the system.c example Richard linked me to in the previous message. I am using the compile string from the website.</div></blockquote><div><br>Just for clarity, this is the compile command:<br>
<br>gcc -o system -Wall system.c `pkg-config --cflags --libs packagekit`<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div dir="ltr">
At first try, I got the following error:<br><br>
system.c: In function 'main':<br>system.c:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token<br>system.c:15: error: 'obj' undeclared (first use in this function)<br>
system.c:15: error: (Each undeclared identifier is reported only once<br>
system.c:15: error: for each function it appears in.)<br>system.c:60: warning: implicit declaration of function 'pk_package_list_get_obj'<br><br>Then I tried to find the culprit of the first error "error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token". I removed the "const" from the line "const PkPackageObj *obj;" and tried to compile, giving me the error output:<br>
<br>system.c: In function 'main':<br>system.c:18: error: 'PkPackageObj' undeclared (first use in this function)<br>system.c:18: error: (Each undeclared identifier is reported only once<br>system.c:18: error: for each function it appears in.)<br>
system.c:18: error: 'obj' undeclared (first use in this function)<br>system.c:63: warning: implicit declaration of function 'pk_package_list_get_obj'<br><br>I then tried to track down which header PkPackageObj was being declared in. I grep'd for the string in the libpackagekit directory from the git main branch (0.2.3) image and noticed it was used in <pk-package-list.h> and <pk-package-obj.h>. Also I searched for "pk_package_list_get_obj" which was used in <pk-package-list.h>.<br>
<br>
I added those header includes to the file, tried to compile again and got the same errors. So I looked in /usr/include/packagekit and noticed that 'pk-package-obj.h' does not exist there, but 'pk-package-list.h' does. <br>
<br>[/usr/include/packagekit/]<br>pk-catalog.h pk-client.h pk-common.h pk-connection.h pk-control.h pk-debug.h pk-enum.h pk-extra.h pk-package-id.h pk-package-ids.h pk-package-item.h pk-package-list.h pk-task-list.h<br>
<br>I grep'd for PkPackageObj here are could not find it. I recursively grep'd the entire /usr/include branch for PkPackageObj and found nothing.<br><br>And this is where my ideas ended. HELP! :)<br><br>Thanks,<br>
<font color="#888888">
-Dorian</font><div><div></div><div class="Wj3C7c"><br><br><div class="gmail_quote">On Thu, Aug 7, 2008 at 2:34 AM, Richard Hughes <span dir="ltr"><<a href="mailto:hughsient@gmail.com" target="_blank">hughsient@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>On Wed, 2008-08-06 at 18:53 -0700, Dorian Perkins wrote:<br>
> Hello again,<br>
><br>
> So I have another question now. In reference to the example at hand,<br>
> the FAQ mentions:<br>
</div>> * InstallPackageName("openoffice-clipart")<br>
<div>> * InstallProvideFile("/usr/share/fonts/sarai/Sarai_07.ttf")<br>
> * InstallLocalFile("/home/dave/Desktop/lirc-0.6.6-4.rhfc1.dag.i686.rpm")<br>
> * InstallMimeType("application/x-rpm")<br>
> * InstallFont("lang(en_GB)")<br>
> "<br>
><br>
> However, I'd like to do other tasks such as EnableRepo() and<br>
> GetRepoList(), etc. How can I do this? Am I approaching this the wrong<br>
> way?<br>
<br>
</div>Well, the problem is that you are using the session "easy" interface.<br>
See <a href="http://www.packagekit.org/pk-faq.html#session-system" target="_blank">http://www.packagekit.org/pk-faq.html#session-system</a> for an<br>
explanation of why you would want to use the session interface in an<br>
trivial application, but the system one for more complex or for<br>
integrated use cases.<br>
<br>
To do RepoEnable you'll need to use the system service -- it's more<br>
complicated but much more powerful. Luckily there are some nice GObject<br>
bindings that make it a lot easier to work with. Have a look at an<br>
example file I just uploaded: <a href="http://www.packagekit.org/files/system.c" target="_blank">http://www.packagekit.org/files/system.c</a><br>
-- all the docs for that are here: <a href="http://www.packagekit.org/gtk-doc/" target="_blank">http://www.packagekit.org/gtk-doc/</a><br>
<br>
That's certainly some reading for you to do! :-)<br>
<div><div></div><div><br>
Richard.<br>
<br>
<br>
<br>
_______________________________________________<br>
PackageKit mailing list<br>
<a href="mailto:PackageKit@lists.freedesktop.org" target="_blank">PackageKit@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/packagekit" target="_blank">http://lists.freedesktop.org/mailman/listinfo/packagekit</a><br>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><br></div>