编译好APR 静态库
1.新建VS2010 C++空项目
2.配置头文件ARP目录
3.配置库目录
4.添加附加依赖项:ws2_32.lib mswsock.lib rpcrt4.lib apr-1.lib
5.添加预处理器定义 (宏):APR_DECLARE_STATIC
6.新建一个main.cpp 实例
```例
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include "apr_general.h"
#include "apr_pools.h"
#define MEM_ALLOC_SIZE 1024
int main()
{
apr_status_t rv;
apr_pool_t *mp;
char *buf1;
char *buf2;
/* per-process initialization */
rv = apr_initialize();
if (rv != APR_SUCCESS) {
assert(0);
return -1;
}
/* create a memory pool. */
apr_pool_create(&mp, NULL);
/* allocate memory chunks from the memory pool */
buf1 = (char*)apr_palloc(mp, MEM_ALLOC_SIZE);
buf2 = (char*)apr_palloc(mp, MEM_ALLOC_SIZE);
/* destroy the memory pool. These chunks above are freed by this */
apr_pool_destroy(mp);
apr_terminate();
return 0;
}
..........................