加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

C中的编译器错误:在’*’标记之前预期’)’

发布时间:2020-12-16 06:49:35 所属栏目:百科 来源:网络整理
导读:正如标题所说,在尝试编译时不断收到此错误.从谷歌搜索这个错误人们说,它没有在头文件中声明,但我的功能是静态的,它不在头文件中,我原型. #include recGbl.h#include devSup.h#include devLib.h#include drvIpac.h#include dbScan.h#include epicsExport.hsta
正如标题所说,在尝试编译时不断收到此错误.从谷歌搜索这个错误人们说,它没有在头文件中声明,但我的功能是静态的,它不在头文件中,我原型.

#include <recGbl.h>
#include <devSup.h>
#include <devLib.h>
#include <drvIpac.h>
#include <dbScan.h>
#include <epicsExport.h>

static int cardinit(cardinfo *card);   // <-- line that gives the error

typedef struct cardinfo{
  struct cardinfo *next;

  struct io_mem_read *pMem;   /* IP register (A16) mem address */
  word *rambase;             /* RAM conversion memory mem address*/

  int isconfigured;
  int doram;   /* 1 if we are using the RAM to output data.
          0 if we are writing to registers (AO style) */

  int cardnum;
  int vmeslotnum;
  int ipslotnum;


  /* these values mirror the hardware registers */
  word csr;
  word offset;
  word numconv;
  word clockrate;
  word vectnum;


  word dacval[MAXSIGNAL];

  word oldispresent;
  /* used to detect a reinsertion of a carrier card.
     see subroutine ispresent() below. */

  /* use to update process variables */
  IOSCANPVT ioscanpvt;
} cardinfo;

static int Hy8402init(int vmeslot,int ipslot,int clockrate) {
    cardinfo *card;

    card->vmeslotnum = vmeslot;
    card->ipslotnum = ipslot;
    card->cardnum = 1;

    card->clockrate = clockrate;
    card->vectnum = 10;

    cardinit(card);

return TRUE;
}

static int cardinit(cardinfo *card){
  word rprobe;
  int res;
  volatile word *ramptr;

  card->pMem= ipmBaseAddr(card->vmeslotnum,card->ipslotnum,ipac_addrIO);  
  if (card->pMem==NULL){
    printf("Error in %s",devstr);
    printf( "%s: Cannot determine base addressn",devstr);
    return FALSE;
  }

  res=devReadProbe(sizeof (word),(char *) card->pMem,(char *) &rprobe);
  if (res!=OK){
    printf("%s: NO DEVICE at %x (vmeslot %d,ipslot %d)n",devstr,(int)card->pMem,card->vmeslotnum,card->ipslotnum);
    return FALSE;
  }
return TRUE;
}

`

解决方法

在错误的行上仍未定义cardinfo结构.在它面前提出前瞻性声明:

struct cardinfo;
static int cardinit(struct cardinfo *card);

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读