A solution for conflict of structure loc_t in header files of vac compiler and informix esql on AIX

I encountered an error several days ago when a program based on informix esql was compiled on AIX platform. Error message:

 

 

"/informix/incl/esql/locator.h", line 124.7: 1540-0400 (S) "loc_t" has a conflicting declaration.
"/usr/include/sys/localedef31.h", line 195.3: 1540-0425 (I) "loc_t" is defined on line 195 of "/usr/include/sys/localedef31.h".
make: 1254-004 The error code from the last command is 1.

 

 

The version of Informix CliSDK is 2.81.FC2.AIX5L, and the same error occured when I compiled it using different vac compiler in version 6.0 and 7.0.

  

According to the error message, it's easy to locate the problem. I checked both two header files.  Both files include definition of a structure loc_t with totally different content. The file localedef31.h should be used in customised program because it includes the format definition of currency, time, number and so on, while loc_t in locator.h is defined for accessing large object in Informix.

 

By consulting the Informix technician, I got to know there is a pre-compilationmacro _H_LOCALEDEF to invalidate the defintion in vac compiler. And the definition in Informix esql header file can also be invalidated by introduction of pre-compilation macro IFX_DISABLE_LOC_T if the Informix CliSDK verion is 3.50 or higher.

 

 

As for our project, we have to access the large object and the definition of loc_t in Informix esql should be kept.  Therefore I added -D_H_LOCALEDEF in makefile to remove the conflict.  

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值