Informix ec 程序从unix到redhat移植中的兼容问题

王朝system·作者佚名  2006-01-31
窄屏简体版  字體: |||超大  

环境:

hpunix11

redhet linux e3

Informix 9.4

Informix client sdk 2.81 uc3

在以上环境中将unix上的代码移植到redhat linux上时,会发生编译错误:

undefined reference to _ctype_b

undefined reference to _ctype_toupper

undefined reference to _ctype_tolower

这是由于redhat linux和高版本的informix esqlc 库文件不兼容造成的,要解决该问题,将以下代码命名为“linuxpatch.c”,在要移植的代码中包含该文件,并在main函数中调用ctSetup函数,就可以通过编译了。

#include <ctype.h>

__const unsigned short int *__ctype_b;

__const __int32_t *__ctype_tolower;

__const __int32_t *__ctype_toupper;

void ctSetup()

{

__ctype_b = *(__ctype_b_loc());

__ctype_toupper = *(__ctype_toupper_loc());

__ctype_tolower = *(__ctype_tolower_loc());

}

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航