eXosip2未知类型名称

时间:2013-09-18 05:53:07

标签: c sip

Ubuntu 12.04 LTS

我下载了: libosip2-4.0.0.tar.gz libeXosip2-4.0.0.tar.gz

解开他们并执行: 。/配置 使 为每个安装make install没有错误。 当我编译时,我收到此错误:

gcc -std=c99 qualySip.c
qualySip.c: In function ‘main’:
qualySip.c:32:3: error: unknown type name ‘eXosip_t’

这是代码:

#include <sys/socket.h>
#include <netinet/in.h>
#include <eXosip2/eXosip.h>
#include <stdint.h>

int main(int argc, char **argv) { 

  // Initialize the osip trace (compile this code with -DENABLE_TRACE)
  int i;
  eXosip_t *ctx;
  int port = 5060;
  TRACE_INITIALIZE (6, NULL);

  // Initialize eXosip (and osip) stack
  ctx = eXosip_malloc();
  if (ctx==NULL)
    return -1;

  i=eXosip_init(ctx);
  if (i!=0)
  return -1;

  // Open a TCP socket for signalling
  i = eXosip_listen_addr(ctx,IPPROTO_TCP, NULL, port, AF_INET, 0);
  if(i != 0){
    eXosip_quit(ctx);
    fprintf(stderr, "Could not initialize transport layer\n");
    return -1;
  }

return 0; //done

}

这是文件搜索:

find / -name "eXosip.h"
/usr/include/eXosip2/eXosip.h
/usr/local/src/pcap/libeXosip2-4.0.0/include/eXosip2/eXosip.h

我也试过了:

gcc -std=c99 qualySip.c -I/usr/local/src/pcap/libeXosip2-4.0.0/include/

1 个答案:

答案 0 :(得分:0)

在eXosip_t类型之前输入struct,如:

struct eXosip_t *ctx;