Ubuntu 12.04 LTS
我下载了:libosip2-4.0.0.tar.gz libeXosip2-4.0.0.tar.gz
解压它们并执行: ./configure make make install for each 没有错误。当我编译我得到这个错误:
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/