View previous topic :: View next topic |
Author |
Message |
idl Retired Dev


Joined: 24 Dec 2002 Posts: 1728 Location: Nottingham, UK
|
Posted: Sun Jul 06, 2003 11:26 pm Post subject: Using xmmscrtl.h and more importantly glib.h |
|
|
OK, so in my attempts to write something usefull, I'm wanting to control xmms for my project.
I found out about libxmms, which had 0% documentation. I managed to find a Python script for Xchat that used libxmms. It turns out the file for remote control is xmms/xmmsctrl.h. I wrote a small program just to test out one of the xmms_remote functions. I found a little breakage where xmmsctrl.h wants to include glib.h. Now, on Gentoo glib headers are seperated into two dirs, glib-1.2 and glib-2.0, there is no glib.h in the base /usr/include directory. So I modified the xmmsctrl.h to point to glib-1.2/glib.h and try to compile again, but now glib.h can't find glibconfig.h. On my system glibconfig.h is in two locations:
/usr/lib/glib/include/glibconfig.h
/usr/lib/glib-2.0/include/glibconfig.h
Editing glib.h to point to one of these locations is obviously not practical.
So, my question is: How do I use glib.h?
Thanx _________________ a.k.a port001
Found a bug? Please report it: Gentoo Bugzilla |
|
Back to top |
|
 |
pygoscelis Guru

Joined: 07 Jun 2003 Posts: 409
|
Posted: Sun Jul 06, 2003 11:36 pm Post subject: Re: Using xmmscrtl.h and more importantly glib.h |
|
|
It's best to edit out all paths to include files from the source code: Code: | #include <glibconfig.h> | and use -I compilaton options: Code: | gcc -c -I$PATH_TO_GLIB_INCLUDE_DIR your-file.c |
Hm. There's a chance I can't fire up enough neurons at this time of day. Is your question a lot more profound than I think, or what? |
|
Back to top |
|
 |
idl Retired Dev


Joined: 24 Dec 2002 Posts: 1728 Location: Nottingham, UK
|
Posted: Sun Jul 06, 2003 11:45 pm Post subject: Re: Using xmmscrtl.h and more importantly glib.h |
|
|
pygoscelis wrote: | It's best to edit out all paths to include files from the source code: Code: | #include <glibconfig.h> |
|
Thats the point, they don't use implicit locations.
pygoscelis wrote: | and use -I compilaton options: Code: | gcc -c -I$PATH_TO_GLIB_INCLUDE_DIR your-file.c |
|
Can't do that because /usr/lib/glib/include only contains one file: glibconfig.h, no glib.h.
pygoscelis wrote: | Hm. There's a chance I can't fire up enough neurons at this time of day. Is your question a lot more profound than I think, or what? |
I think so  _________________ a.k.a port001
Found a bug? Please report it: Gentoo Bugzilla |
|
Back to top |
|
 |
pygoscelis Guru

Joined: 07 Jun 2003 Posts: 409
|
Posted: Sun Jul 06, 2003 11:50 pm Post subject: |
|
|
You can use more than one -I flag...
Code: | gcc -I/usr/lib/glib/include -I/usr/include/glib ... |
Is there some reason for this not to work for you? |
|
Back to top |
|
 |
idl Retired Dev


Joined: 24 Dec 2002 Posts: 1728 Location: Nottingham, UK
|
Posted: Mon Jul 07, 2003 12:02 am Post subject: |
|
|
pygoscelis wrote: | You can use more than one -I flag...
Code: | gcc -I/usr/lib/glib/include -I/usr/include/glib ... |
Is there some reason for this not to work for you? |
oh yeh, right works now with Code: | gcc xmmsctrl.c -I/usr/lib/glib/include/ -I/usr/include/glib-1.2 -o xmmsctrl |
However it doesn't compile because xmmsctrl.h only contains the function declarations. There are no other files in the xmms include dir that have the actual functions.
bad xmms devs, bad! _________________ a.k.a port001
Found a bug? Please report it: Gentoo Bugzilla |
|
Back to top |
|
 |
pygoscelis Guru

Joined: 07 Jun 2003 Posts: 409
|
Posted: Mon Jul 07, 2003 12:14 am Post subject: |
|
|
port001 wrote: | However it doesn't compile because xmmsctrl.h only contains the function declarations. There are no other files in the xmms include dir that have the actual functions. |
The actual functions are not supposed to be there, they are already compiled into a library. You should link against libxmms (IIRC): Code: | gcc -o your-program your-program.c -lxmms |
You should have libxmms.so.[x.y.z] in /usr/lib. |
|
Back to top |
|
 |
idl Retired Dev


Joined: 24 Dec 2002 Posts: 1728 Location: Nottingham, UK
|
Posted: Mon Jul 07, 2003 12:28 am Post subject: |
|
|
pygoscelis wrote: | port001 wrote: | However it doesn't compile because xmmsctrl.h only contains the function declarations. There are no other files in the xmms include dir that have the actual functions. |
The actual functions are not supposed to be there, they are already compiled into a library. You should link against libxmms (IIRC): Code: | gcc -o your-program your-program.c -lxmms |
You should have libxmms.so.[x.y.z] in /usr/lib. |
ahh thanks getting there slowly
Is it possible to load in a library from the source? Or must it be linked in? _________________ a.k.a port001
Found a bug? Please report it: Gentoo Bugzilla |
|
Back to top |
|
 |
pygoscelis Guru

Joined: 07 Jun 2003 Posts: 409
|
Posted: Mon Jul 07, 2003 12:32 am Post subject: |
|
|
What do you mean, load the library from the source? Dynamic linking?
Try
But I don't see why do you need this. |
|
Back to top |
|
 |
idl Retired Dev


Joined: 24 Dec 2002 Posts: 1728 Location: Nottingham, UK
|
Posted: Mon Jul 07, 2003 12:44 am Post subject: |
|
|
pygoscelis wrote: | What do you mean, load the library from the source? Dynamic linking?
Try
But I don't see why do you need this. |
Don't need it, just wondered if it was possible to do it without having to use -lxmms.
Thank you for your help  _________________ a.k.a port001
Found a bug? Please report it: Gentoo Bugzilla |
|
Back to top |
|
 |
|