- 论坛徽章:
- 0
|
一个简单的程序,在32位机器上编译没遇到问题,移植到64位机器上后编译提示很多错误。哪位大侠有过这样的经历,帮忙解释一下,不胜感激。
#include <stdio.h>;
EXEC SQL include sqlca ;
main()
{
EXEC SQL BEGIN DECLARE SECTION ;
char dbname[20] ;
int a ;
EXEC SQL END DECLARE SECTION ;
strcpy( dbname, (char *)getenv("DBNAME" ) ;
EXEC SQL DATABASE :dbname ;
EXEC SQL SELECT a INTO :a FROM tab1 WHERE b=1 ;
EXEC SQL CLOSE DATABASE ;
exit(0) ;
}
编译信息:
esql -o a a.ec
"a.ec", line 11.33: 1506-304 (W) No function prototype given for "getenv".
"a.ec", line 11.9: 1506-304 (W) No function prototype given for "strcpy".
"a.ec", line 11.25: 1506-745 (I) 64-bit portability: possible incorrect pointer through conversion o
f int type into pointer.
"a.ec", line 14.25: 1506-495 (I) Pointer type conversion found.
"a.ec", line 14.25: 1506-374 (I) Pointer types "char*" and "int*" are not compatible.
"a.ec", line 17.9: 1506-304 (W) No function prototype given for "exit". |
|