This article was originally posted in my csdn.net blog on 6 May 2009.
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 compilers 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-compilation macro _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 resolve the conflict.
No comments:
Post a Comment