Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Using xmmscrtl.h and more importantly glib.h
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
idl
Retired Dev
Retired Dev


Joined: 24 Dec 2002
Posts: 1728
Location: Nottingham, UK

PostPosted: Sun Jul 06, 2003 11:26 pm    Post subject: Using xmmscrtl.h and more importantly glib.h Reply with quote

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
View user's profile Send private message
pygoscelis
Guru
Guru


Joined: 07 Jun 2003
Posts: 409

PostPosted: Sun Jul 06, 2003 11:36 pm    Post subject: Re: Using xmmscrtl.h and more importantly glib.h Reply with quote

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
View user's profile Send private message
idl
Retired Dev
Retired Dev


Joined: 24 Dec 2002
Posts: 1728
Location: Nottingham, UK

PostPosted: Sun Jul 06, 2003 11:45 pm    Post subject: Re: Using xmmscrtl.h and more importantly glib.h Reply with quote

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
View user's profile Send private message
pygoscelis
Guru
Guru


Joined: 07 Jun 2003
Posts: 409

PostPosted: Sun Jul 06, 2003 11:50 pm    Post subject: Reply with quote

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
View user's profile Send private message
idl
Retired Dev
Retired Dev


Joined: 24 Dec 2002
Posts: 1728
Location: Nottingham, UK

PostPosted: Mon Jul 07, 2003 12:02 am    Post subject: Reply with quote

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.
:evil: bad xmms devs, bad!
_________________
a.k.a port001
Found a bug? Please report it: Gentoo Bugzilla
Back to top
View user's profile Send private message
pygoscelis
Guru
Guru


Joined: 07 Jun 2003
Posts: 409

PostPosted: Mon Jul 07, 2003 12:14 am    Post subject: Reply with quote

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
View user's profile Send private message
idl
Retired Dev
Retired Dev


Joined: 24 Dec 2002
Posts: 1728
Location: Nottingham, UK

PostPosted: Mon Jul 07, 2003 12:28 am    Post subject: Reply with quote

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 :D 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
View user's profile Send private message
pygoscelis
Guru
Guru


Joined: 07 Jun 2003
Posts: 409

PostPosted: Mon Jul 07, 2003 12:32 am    Post subject: Reply with quote

What do you mean, load the library from the source? Dynamic linking?
Try
Code:
man dlopen

But I don't see why do you need this.
Back to top
View user's profile Send private message
idl
Retired Dev
Retired Dev


Joined: 24 Dec 2002
Posts: 1728
Location: Nottingham, UK

PostPosted: Mon Jul 07, 2003 12:44 am    Post subject: Reply with quote

pygoscelis wrote:
What do you mean, load the library from the source? Dynamic linking?
Try
Code:
man dlopen

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum