Re: [DBD-Informix v0.52] compilation errors using SUNWspro SC3.1
Posted in 1997
Sometimes I hate the ESQL/C compiler! }From: Binh Thanh Nguyen <nbt@CERF.net> }Date: Wed, 12 Mar 1997 10:42:41 -0800 (PST) }X-Informix-List-Id: <list.13514> } }Dear all, } }I successfully installed DBD::Informix v0.52 on } Sparc 20 } Sun Solaris 2.5 }using gcc 2.7.1 } esqlc-7.13 } }Passing all tests. } }I have problems with the same settings using SUNWspro SC3.1. I got }compilation errors. Would someone out there have the same problem }with SUNWspro SC3.1. Ensure that you are using the correct ANSI-compliant flag, -Xa, so that __STDC__ is set. You could probably use -Xc instead. The problem comes from the fact that <stdio.h> is being included twice, once before the lines in the ESQL/C output which contain the #define const, and once after these lines. --- start of generated C file --- #include <sqlhdr.h> #include <sqlca.h> #if !defined(__STDC__) #define const #endif #line 1 "dbdimp.ec" [...] Further, because you are not using one of the -X[a|c] flags, __STDC__ is not defined. For the first run through <stdio.h>, const is left untouched, but for the second, the compiler does not see any of the const keywords. Hence, the prototypes for the functions getopt and getsubopt have magically changed. Ugh!!!! I'm not even going to try and defend the code emitted by the ESQL/C compiler. The const stuff should be handled inside <sqlhdr.h>, not in every file. Nevertheless, we have to live with what we get, and the workaround is clear -- and documented in Makefile.PL, though I note I have a spelling mistake in one of the comments. Ensure that __STDC__ is defined by the compiler. The next version of DBD::Informix has a simple ESQL/C test program which ensures that things are setup OK, and I'll add a test for __STDC__ into that. There are too many different ways in which things fail because the basic Informix setup isn't quite correct. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> }regards, }binh } }--------------- Compliation Output ---------------------------------------- } }$ perl Makefile.PL } }Configuring DBD::Informix version 0.52... }Remember to actually read the README file! } }Using INFORMIX-ESQL Version 7.13.UC1 from /users/informix/7.13 } }Writing Informix.pm } }Perl: perl5.003 sun4-solaris dl_dlopen.xs }System: sunos pike 5.5 generic sun4m sparc sunw,sparcstation-5 }Compiler: cc -O -I/usr/local/include } }See README notes about SPARCompiler on Solaris } }Checking if your kit is complete... }Looks good }Writing Makefile for DBD::Informix } }$ make }cp InformixTest.pm ./blib/lib/DBD/InformixTest.pm }cp Informix.pm ./blib/lib/DBD/Informix.pm }//bin/perl -I/usr/local/lib/perl5/sun4-solaris/5.003 -I/usr/local/lib/perl5 /usr }/local/lib/perl5/ExtUtils/xsubpp -typemap /usr/local/lib/perl5/ExtUtils/typemap } Informix.xs >xstmp.c && mv xstmp.c Informix.c }cc -c -I/users/informix/7.13/incl/esql -I/usr/local/lib/perl5/sun4-solaris/5.003 }/DBI -I/usr/local/lib/perl5/site_perl/sun4-solaris/auto/DBI -I/usr/local/include } -O -DVERSION=\\"0.52\\" -DXS_VERSION=\\"0.52\\" -Kpic -I/usr/local/lib/perl5/s }un4-solaris/5.003/CORE -DESQLC_VERSION=713 -DUSE_PROTOTYPES Informix.c }"Informix.c", line 222: warning: end-of-loop code not reached }"Informix.c", line 376: warning: end-of-loop code not reached }"Informix.c", line 418: warning: end-of-loop code not reached }"Informix.c", line 516: warning: end-of-loop code not reached }"Informix.c", line 521: warning: end-of-loop code not reached }INFORMIXC="//bin/perl esqlcc" ESQLCC="cc" esql -c -I/users/informix/7.13/incl/es }ql -I/usr/local/lib/perl5/sun4-solaris/5.003/DBI -I/usr/local/lib/perl5/site_per }l/sun4-solaris/auto/DBI -I/usr/local/include -O -DVERSION=\\"0.52\\" -DXS_VER }SION=\\"0.52\\" -Kpic -I/usr/local/lib/perl5/sun4-solaris/5.003/CORE -DESQLC_VERSI }ON=713 -DUSE_PROTOTYPES sqltype.ec }rm -f sqltype.c }INFORMIXC="//bin/perl esqlcc" ESQLCC="cc" esql -c -I/users/informix/7.13/incl/es }ql -I/usr/local/lib/perl5/sun4-solaris/5.003/DBI -I/usr/local/lib/perl5/site_per }l/sun4-solaris/auto/DBI -I/usr/local/include -O -DVERSION=\\"0.52\\" -DXS_VER }SION=\\"0.52\\" -Kpic -I/usr/local/lib/perl5/sun4-solaris/5.003/CORE -DESQLC_VERSI }ON=713 -DUSE_PROTOTYPES ixblob.ec }rm -f ixblob.c }cc -c -I/users/informix/7.13/incl/esql -I/usr/local/lib/perl5/sun4-solaris/5.003 }/DBI -I/usr/local/lib/perl5/site_perl/sun4-solaris/auto/DBI -I/usr/local/include } -O -DVERSION=\\"0.52\\" -DXS_VERSION=\\"0.52\\" -Kpic -I/usr/local/lib/perl5/s }un4-solaris/5.003/CORE -DESQLC_VERSION=713 -DUSE_PROTOTYPES decsci.c }INFORMIXC="//bin/perl esqlcc" ESQLCC="cc" esql -c -I/users/informix/7.13/incl/es }ql -I/usr/local/lib/perl5/sun4-solaris/5.003/DBI -I/usr/local/lib/perl5/site_per }l/sun4-solaris/auto/DBI -I/usr/local/include -O -DVERSION=\\"0.52\\" -DXS_VER }SION=\\"0.52\\" -Kpic -I/usr/local/lib/perl5/sun4-solaris/5.003/CORE -DESQLC_VERSI }ON=713 -DUSE_PROTOTYPES dbdimp.ec }"/usr/include/stdlib.h", line 148: identifier redeclared: getopt } current : function(int, pointer to pointer to char, pointer to char) ret }urning int } previous: function(int, pointer to const pointer to char, pointer to con }st char) returning int : "/usr/include/stdio.h", line 242 }"/usr/include/stdlib.h", line 149: identifier redeclared: getsubopt } current : function(pointer to pointer to char, pointer to pointer to cha }r, pointer to pointer to char) returning int } previous: function(pointer to pointer to char, pointer to const pointer }to char, pointer to pointer to char) returning int : "/usr/include/stdio.h", lin }e 244 }cc: acomp failed for dbdimp.c }*** Error code 2 }make: Fatal error: Command failed for target `dbdimp.o'