[数据库中间件]centos6.6下配置libzdb所产生的错误

1、关于gmtime_r、timegm的隐藏声明错误,从系统的time.h中复制两个函数引用到libzdb自己定义的time.h,代码如下:

extern struct tm *gmtime_r (const time_t *__restrict __timer,
                struct tm *__restrict __tp) __THROW;
extern time_t timegm (struct tm *__tp) __THROW;

2、在eclipse for c/c++中编译报C99错误,如下路径中添加如下内容:

右击项目->properities->c/c++ Build->setting->tool settings->GCC C Compiler右边的“Command:”框中由原来的“gcc”改为“gcc --std=c99”;

3、INT32_MAX、INT32_MIN未声明错误,加如下代码:

#include <stdint.h>  
#include <inttypes.h>  

4、遇到oracle句柄等以OCI开头的未定义问题 ,mysql等的未定义问题,以及collect2: 错误:ld 返回 1是库未连接的问题。解决如下:

setting->complier->complier setting->other options中添加:`mysql_config --cflags`
linker settings->link libraries中添加:libpthread.so.0
linker settings->other link options中添加:
-L/oradb/ora10g/oracle/product/10.2.0/db_1/lib/ -lclntsh
`mysql_config --libs`

5、遇到error while loading shared libraries: libdb2.so.11.1: cannot open shared object file: No such file or directory类似的错误

在/etc/ld.so.conf 文件中添加:
所显示这个动态链接库的目录,我这里出现过libdb2.so.1和liblclntsh.so.11.1的错误,因此我添加了两个路径如下
/home/oracle/sqllib/lib64
/oracle/oraclebase/product/11.2.0/db_1/lib
然后执行命令ldconfig,可能会出现错误但是再执行程序已经可以执行了