You are not logged in.
Hi, it's me again.
I get this error when I try to compile the code:
xmms-control.cpp: In function 'int main(int, char**)':
xmms-control.cpp:10: error: invalid conversion from 'char*' to 'gint'
xmms_remote_set_main_volume() requires two gint parameters, but it can't convert it
Here's the code:
#include <xmms/xmmsctrl.h>
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
gint session = 0;
gint vol = argv[1];
xmms_remote_set_main_volume(session, vol);
return 0;
}
Why is that?
*edit: The idea is to get a command-line argument and pass it to the xmms_blabla() function. If there's an alternative way to do this, tell me.
Last edited by Boris Bolgradov (2009-07-25 09:04:11)
Offline
As far as I can tell gint is a typedef from glib for a standard C int type (according to this [1]). If this is the case you could use atoi(argv[1]) to convert the input argument to an int / gint. That's pretty ugly I think but it might work as long as you only pass in integer values that atoi can handle.
Offline
Thanks
Offline