- From: Gergely Imreh <imrehg_at_gmail.com>
- Date: Mon, 20 Aug 2007 21:13:36 +0100
On 20/08/07, José Alejandro López Corella <corella91_at_yahoo.com> wrote:
> hello they can help me with this error that marks when
> compiling an application
>
> root_at_alejandro-desktop:/root/proyecto# gcc inp0.c
> -lcomedi -lm -o inp0
> inp0.c: In function 'main':
> inp0.c:21: error: dereferencing pointer to incomplete
> type
> inp0.c:22: warning: passing argument 2 of
> 'comedi_to_phys' makes pointer from integer without a
> cast
> inp0.c:22: error: too many arguments to function
> 'comedi_to_phys'
> root_at_alejandro-desktop:/root/proyecto#
>
>
> #include <stdio.h> /* for printf() */
> #include <comedi.h> /* also included by comedilib.h */
> #include <comedilib.h> /* 'cuz we're using comedilib*/
> int subdev = 0; /* change this to your input
> subdevice */
> int chan = 0; /* change this to your channel
> */
> int range = 0; /* more on this later */
> int aref = 0; /* more on this later */
> int main(int argc,char *argv[])
> {
> comedi_t *cf;
> int chan=0;
> lsampl_t data;
> int maxdata,rangetype;
> double volts;
>
> cf=comedi_open("/dev/comedi0");
> maxdata=comedi_get_maxdata(cf,subdev,chan);
>
> rangetype=comedi_get_rangetype(cf,subdev,chan);
>
>
> comedi_data_read(cf->fd,subdev,chan,range,aref,&data);
> volts=comedi_to_phys(data,rangetype,range,maxdata);
> printf("%d %g\n",data,volts);
> return 0;
> }
>
>
> root_at_alejandro-desktop:/root/proyecto# gcc inp0.c
> -lcomedi -lm -o inp0
> inp0.c: In function 'main':
> inp0.c:21: error: dereferencing pointer to incomplete
> type
> inp0.c:22: warning: passing argument 2 of
> 'comedi_to_phys' makes pointer from integer without a
> cast
> inp0.c:22: error: too many arguments to function
> 'comedi_to_phys'
> root_at_alejandro-desktop:/root/proyecto#
>
>
>
If you check it, the comedi_phys only has 3 arguments:
double comedi_to_phys(lsampl_t data, comedi_range * range, lsampl_t maxdata);
http://www.comedi.org/doc/r5619.html
Greg
Received on 2007-08-20Z19:13:36