esql and cygwin
Posted in 2010
Dirk couldn't preprocess a trivial .ec file with 'esql -p' from Cygwin (CSDK 3.50/ESQL 3.50.FC6): it failed with "error -55922: Preprocessor detected errors", while the same command worked fine from a normal Windows command prompt. Art suspected the DLL search path; Marco supplied his esqlcyg wrapper script (which converts the environment between Cygwin and DOS and handles -mno-cygwin), suggested a bad $include and checking that INFORMIXDIR is set Windows-style. None helped; the Windows event log showed esqlc.exe crashing in msvcr80.dll. The thread ends with Marco asking whether 32-bit CSDK behaves the same, and no resolution is recorded.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
Hi, I try to compile (preprozess) a simple .ec file in cygwin like esql -p test.ec and get the message IBM Informix CSDK Version 3.50, IBM Informix-ESQL Version 3.50.FC6 esql: error -55922: Preprocessor detected errors. When I use the precompile prozess on "normal" DOS command prompt it works fine. A test.c will be created with no errors. Any hint what could be wrong? Perhaps the environment DOS/Unix? TIA Dirk
Most likely the shared libraries (.dll files) that the ESQL/C compiler uses are not in its search path under Cygwin. Art Art S. Kagel Advanced DataTools (www.advancedatatools.com) IIUG Board of Directors (art@iiug.org) See you at the 2010 IIUG Informix Conference April 25-28, 2010 Overland Park (Kansas City), KS www.iiug.org/conf Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Advanced DataTools, the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Thu, May 6, 2010 at 7:25 AM, DIRK NIEMEIER <dirk.niemeier@stueken.de>wrote: > Hi, > I try to compile (preprozess) a simple .ec file in cygwin like > esql -p test.ec > and get the message > > IBM Informix CSDK Version 3.50, IBM Informix-ESQL Version 3.50.FC6 > esql: error -55922: Preprocessor detected errors. > > When I use the precompile prozess on "normal" DOS command prompt it works > fine. A test.c will be created with no errors. > > Any hint what could be wrong? Perhaps the environment DOS/Unix? > > TIA > Dirk > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --000e0cd32f5002dec60485ec85c1
Dear Art, I think that will bring on the right way, but all DOS path entries are available in cygwin. But they are changed from C:\\\\Program Files\\\\IBM\\\\Informix\\\\Client-SDK\\\\bin to /cygdrive/c/Program Files/IBM/Informix/Client-SDK/bin for example. And I think they are correct translated. Any suggestions? TIA Dirk
DIRK NIEMEIER wrote:
> Dear Art,
> I think that will bring on the right way, but all DOS path entries are
> available in cygwin. But they are changed from
> C:\\\\Program Files\\\\IBM\\\\Informix\\\\Client-SDK\\\\bin to
> /cygdrive/c/Program Files/IBM/Informix/Client-SDK/bin for example. And I
think
> they are correct translated.
>
> Any suggestions?
>
> TIA
> Dirk
>
the attached script is take from my SQSL tool. it will take care translating
the environment in between cygwin and dos and back. Read the comments
carefully and consider where you would need to use the -mno-cygwin parameter:
you are virtually guaranteed memory allocation segvs if you don't where you
should, as cygwin and Visual C use different and incompatible memory
allocation routines.
--
Ciao,
Marco
______________________________________________________________________________
Marco Greco /UK /IBM Standard disclaimers apply!
Structured Query Scripting Language http://www.4glworks.com/sqsl.htm
4glworks http://www.4glworks.com
Informix on Linux http://www.4glworks.com/ifmxlinux.htm
#!/usr/bin/sh
# "@(#) esqlcyg 0.1"
#
# esqlcyg - fronted for the esql/c precompiler
#
# The Structured Query Scripting Language
# Copyright (C) 1992-2009 Marco Greco (marco@4glworks.com)
#
# Initial release: Jan 09
# Current release: Jan 09
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Please note that the libraries linked are the bear minimum SQSL needs, and
# do not necessarely cover everything esql would need. This may not be
# enough if you have just hijacked this script for your own purposes.
# Experiment with esql -libs -dcmdl to see what else you may need.
#
# Also note that SQSL has a requirement to be able to choose whether to
# compile and link with -mno-cygwin (the way the informix libraries were
# built) or not (to be able to take advantage of POSIX calls) depending on
# what is being built. Mixing and matching -mno-cygwin executables is
# risky business and may lead to crashes. Not using -mno-cygwin with
# esql/c libraries is risky business and may lead to crashes.
# If you have hijacked this script for your own purposes, you should
# be using -mno-cygwin anyhow.
#
# -mno-cygwin requires that you have installed the mingw compiler alongside
# the cygwin one. No need to dig anything from mingw.org: the standard cygwin
# installation ships a mingw compiler.
#
IDIR="`cygpath -u $INFORMIXDIR`"
INFORMIXDIR="`cygpath -w $INFORMIXDIR`"
INFORMIXC=${INFORMIXC:-cc}DEFINES='-D__int64="long long"'
export INFORMIXDIR
OTHERARGS=
CFILES=
ECFILES=
NOLINK=
ECOPTS=
DB2OPT=
if test $# -lt 2
then
echo "how about some parameters?"
exit 1
fi
if test -z "$INFORMIXDIR"
then
echo INFORMIXDIR not set
exit 1
fi
for i in "$@"
do
case "$i" in
#
# other esql/c opts here
#
-n|\\\\
-nowarn)
ECOPTS="$ECOPTS $i"
;;
-c)
NOLINK=1
OTHERARGS="$OTHERARGS $i"
;;
-I*)
ECOPTS="$ECOPTS $i"
OTHERARGS="$OTHERARGS \\\\"$i\\\\""
;;
-db2)
ECOPTS="$ECOPTS $i"
DB2OPT=1
;;
*\\\\.ec)
BASE="$(basename "$i" .ec)"
CFILES="$CFILES $BASE.c"
ECFILES="$ECFILES \\\\"$i\\\\""
;;
*)
OTHERARGS="$OTHERARGS \\\\"$i\\\\""
;;
esac
done
# pre-process .ec files
if test -n "$ECFILES"
then
eval esql -p $ECOPTS $ECFILES || exit 1
fi
# pass processed files to compiler
if test -n "$NOLINK"
then
eval $INFORMIXC $DEFINES -I$IDIR/incl -I$IDIR/incl/esql $CFILES $OTHERARGS
elif test -n "$DB2OPT"
then
#
# unless you exclude exports from the esql/c supplied libraries,
# the linker is likely to complain about some xxx_NO_THUNK_DATA symbol
# not existing, if linking in -mno-cygwin mode. passing -exclude-libs
# to the linker fixes this and does no harm to the standard cygwin gcc
#
eval $INFORMIXC $DEFINES -I$IDIR/incl/esql $CFILES $OTHERARGS \\\\
$IDIR/lib/idb2t09a.lib -Wl,-exclude-libs,idb2t09a.lib
else
eval $INFORMIXC $DEFINES -I$IDIR/incl/esql $CFILES $OTHERARGS \\\\
$IDIR/lib/isqlt09a.lib -Wl,-exclude-libs,isqlt09a.lib
fi
Dear Marco,
I tried out your script, but I can't see an change.
informix@stuekenri53 /cygdrive/c/Install/Informix/test
$ ./esqlcyg -c test.ecIBM Informix CSDK Version 3.50, IBM Informix-ESQL Version 3.50.FC6
esql: error -55922: Preprocessor detected errors.
Any suggestions?
TIA
Dirk
I was thinking more of how the executables search for DLLs which IB is not the PATH. In UNIX it's either LD_LIBRARY_PATH or SHLIB_PATH depending on the version (though all modern UNIXes support the former now). Don't know what Windows uses. Art Art S. Kagel Advanced DataTools (www.advancedatatools.com) IIUG Board of Directors (art@iiug.org) See you at the 2010 IIUG Informix Conference April 25-28, 2010 Overland Park (Kansas City), KS www.iiug.org/conf Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Advanced DataTools, the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Fri, May 7, 2010 at 7:05 AM, DIRK NIEMEIER <dirk.niemeier@stueken.de>wrote: > Dear Art, > I think that will bring on the right way, but all DOS path entries are > available in cygwin. But they are changed from > C:\\\\Program Files\\\\IBM\\\\Informix\\\\Client-SDK\\\\bin to > /cygdrive/c/Program Files/IBM/Informix/Client-SDK/bin for example. And I > think > they are correct translated. > > Any suggestions? > > TIA > Dirk > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --00504502bae171291f048601172f
DIRK NIEMEIER wrote:
> Dear Marco,
> I tried out your script, but I can't see an change.
>
> informix@stuekenri53 /cygdrive/c/Install/Informix/test
> $ ./esqlcyg -c test.ec> IBM Informix CSDK Version 3.50, IBM Informix-ESQL Version 3.50.FC6
> esql: error -55922: Preprocessor detected errors.
>
> Any suggestions?
>
> TIA
> Dirk
well, I reckon there's something in test.ec that the preprocessor doesn't
like, like an $include directive or something
--
Ciao,
Marco
______________________________________________________________________________
Marco Greco /UK /IBM Standard disclaimers apply!
Structured Query Scripting Language http://www.4glworks.com/sqsl.htm
4glworks http://www.4glworks.com
Informix on Linux http://www.4glworks.com/ifmxlinux.htm
Art Kagel wrote: > I was thinking more of how the executables search for DLLs which IB is not > the PATH. In UNIX it's either LD_LIBRARY_PATH or SHLIB_PATH depending on > the version (though all modern UNIXes support the former now). Don't know > what Windows uses. > > Art > windows uses PATH to locate dlls, so LD_LIBRARY_PATH should not be an issue -- Ciao, Marco ______________________________________________________________________________ Marco Greco /UK /IBM Standard disclaimers apply! Structured Query Scripting Language http://www.4glworks.com/sqsl.htm 4glworks http://www.4glworks.com Informix on Linux http://www.4glworks.com/ifmxlinux.htm
Hi Marco, I don't think, that the .EC file includes the problem. I reduced the content to an minimum. test.ec: //$include sqlca; void main(void) { //$char AR001[4]; //$select ar001 into $AR001 from arti; int i=1; } But the same problem on cygwin. On Windows commandprompt it works fine. Any further suggestions? regards, Dirk
Hi, perhaps there is an other hint to analyse the problem. Every time I call the esql from cygwin I get an errorentry in the application eventlog of Windows. Ereignistyp: Fehler Ereignisquelle: Application Error Ereigniskategorie: (100) Ereigniskennung: 1000 Datum: 11.05.2010 Zeit: 13:52:52 Benutzer: Nicht zutreffend Computer: STUEKENRI53 Beschreibung: Fehlgeschlagene Anwendung esqlc.exe, Version 3.50.0.14008, fehlgeschlagenes Modul msvcr80.dll, Version 8.0.50727.4053, Fehleradresse 0x0000000000086b5a. Weitere Informationen über die Hilfe- und Supportdienste erhalten Sie unter http://go.microsoft.com/fwlink/events.asp. Daten: 0000: 41 70 70 6c 69 63 61 74 Applicat 0008: 69 6f 6e 20 46 61 69 6c ion Fail 0010: 75 72 65 20 20 65 73 71 ure esq 0018: 6c 63 2e 65 78 65 20 33 lc.exe 3 0020: 2e 35 30 2e 30 2e 31 34 .50.0.14 0028: 30 30 38 20 69 6e 20 6d 008 in m 0030: 73 76 63 72 38 30 2e 64 svcr80.d 0038: 6c 6c 20 38 2e 30 2e 35 ll 8.0.5 0040: 30 37 32 37 2e 34 30 35 0727.405 0048: 33 20 61 74 20 6f 66 66 3 at off 0050: 73 65 74 20 30 30 30 30 set 0000 0058: 30 30 30 30 30 30 30 38 00000008 0060: 36 62 35 61 6b5a TIA Dirk
DIRK NIEMEIER wrote: > Hi, > perhaps there is an other hint to analyse the problem. Every time I call the > esql from cygwin I get an errorentry in the application eventlog of Windows. Sorry Dirk, I should have replied earlier. The only other thing I can think of is that your INFORMIXDIR is undefined, or set the Cygwin way. It should be set the windows way. -- Ciao, Marco ______________________________________________________________________________ Marco Greco /UK /IBM Standard disclaimers apply! Structured Query Scripting Language http://www.4glworks.com/sqsl.htm 4glworks http://www.4glworks.com Informix on Linux http://www.4glworks.com/ifmxlinux.htm
Hi Marco,
I think the INFORMIXDIR is set Windows like. But see yourself. Perhaps there
is an other environment entry you see.
regards,
Dirk
My Cygwin set:
!::='::\\\\'
!C:='C:\\\\cygwin\\\\bin'
!ExitCode=00000000
ALLUSERSPROFILE='C:\\\\Documents and Settings\\\\All Users'
APPDATA='C:\\\\Documents and Settings\\\\informix\\\\Application Data'
BASH=/usr/bin/bash
BASH_ARGC=()
BASH_ARGV=()
BASH_LINENO=()
BASH_SOURCE=()
BASH_VERSINFO=([0]="3" [1]="2" [2]="49" [3]="23" [4]="release"
[5]="i686-pc-cygwin")
BASH_VERSION='3.2.49(23)-release'
CLASSPATH='C:\\\\PROGRA~1\\\\IBM\\\\IBMINF~1\\\\11.50\\\\extend\\\\krakatoa\\\\krakatoa.jar;C:\\\\PROGRA
~1\\\\IBM\\\\IBMINF~1\\\\11.50\\\\extend\\\\krakatoa\\\\jdbc.jar;'
CLIENTNAME=NIEMEIER
CLIENT_LOCALE=DE_DE.8859-1COLUMNS=223
COMMONPROGRAMFILES='C:\\\\Program Files (x86)\\\\Common Files'
COMPUTERNAME=STUEKENRI53
COMSPEC='C:\\\\WINDOWS\\\\system32\\\\cmd.exe'
CVS_RSH=/bin/ssh
ClusterLog='C:\\\\WINDOWS\\\\Cluster\\\\cluster.log'
CommonProgramFiles(x86)='C:\\\\Program Files (x86)\\\\Common Files'
CommonProgramW6432='C:\\\\Program Files\\\\Common Files'
DBDATE=DMY4.DBFLTMASK=-1
DBTEMP='C:\\\\PROGRA~1\\\\IBM\\\\IBMINF~1\\\\11.50\\\\infxtmp'
DB_LOCALE=DE_DE.8859-1DIRSTACK=()
EUID=1005
FP_NO_HOST_CHECK=NO
GROUPS=()
HISTFILE=/home/informix/.bash_history
HISTFILESIZE=500
HISTSIZE=500
HOME=/home/informix
HOMEDRIVE=C:
HOMEPATH='\\\\Documents and Settings\\\\informix'
HOSTNAME=stuekenri53
HOSTTYPE=i686
IFS=$' \\\\t\\
'
IFX_ONTAPE_FILE_PREFIX=ol_test
INFOPATH=/usr/local/info:/usr/share/info:/usr/info:
INFORMIXC=gcc
INFORMIXDIR='C:\\\\PROGRA~1\\\\IBM\\\\IBMINF~1\\\\11.50'
INFORMIXSERVER=ol_testISMDIR='C:\\\\ISM\\\\2.20'
LANG=C.UTF-8
LINES=56
LOGONSERVER='\\\\\\\\STUEKENRI53'
MACHTYPE=i686-pc-cygwin
MAILCHECK=60
MANPATH=/usr/local/man:/usr/share/man:/usr/man:
NODEFDAC=yes
NUMBER_OF_PROCESSORS=8
OLDPWD=/cygdrive/c/Install/Informix
ONCONFIG=ONCONFIG.ol_testOPTERR=1
OPTIND=1
OS=Windows_NT
OSTYPE=cygwin
PATH='/usr/local/bin:/usr/bin:/bin:/cygdrive/c/PROGRA~1/IBM/IBMINF~1/11.50/bin:/cygdrive/c/ISM/2.20/bin:/cygdrive/c/Program
Files/HP/NCU:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOW
S/System32/Wbem:/cygdrive/c/Program Files (x86)/Panda
Security/WaAgent/Common:/cygdrive/c/Program
Files/jEdit:/cygdrive/c/PROGRA~2/IBM/GSK7_64/bin:/cygdrive/c/PROGRA~2/IBM/GSK7_6
4/lib64:/cygdrive/c/Program Files/IBM/GSK7_64/bin:/cygdrive/c/Program
Files/IBM/GSK7_64/lib64:/cygdrive/c/Program Files/IBM/IBM Informix Dynamic
Server/11.50/bin'
PATHEXT='.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH'
PIPESTATUS=([0]="0")
PPID=1
PRINTER='Microsoft XPS Document Writer'
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_ARCHITEW6432=AMD64
PROCESSOR_IDENTIFIER='EM64T Family 6 Model 26 Stepping 5, GenuineIntel'
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=1a05
PROGRAMFILES='C:\\\\Program Files (x86)'
PROMPT='$P$G'
PS1='\\\\[\\\\e]0;\\\\w\\\\a\\\\]\\
\\\\[\\\\e[32m\\\\]\\\\u@\\\\h \\\\[\\\\e[33m\\\\]\\\\w\\\\[\\\\e[0m\\\\]\\
\\\\$ '
PS2='> '
PS4='+ '
PWD=/cygdrive/c/Install/Informix/test
ProgramFiles(x86)='C:\\\\Program Files (x86)'
ProgramW6432='C:\\\\Program Files'
SESSIONNAME=RDP-Tcp#2
SHELL=/bin/bash
SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:moni
tor
SHLVL=1
SYSTEMDRIVE=C:
SYSTEMROOT='C:\\\\WINDOWS'
TERM=cygwin
UID=1005
USER=informix
USERDOMAIN=STUEKENRI53
USERNAME=informix
USERPROFILE='C:\\\\Documents and Settings\\\\informix'
WINDIR='C:\\\\WINDOWS'
_=test/
f=
DIRK NIEMEIER wrote: > Hi Marco, > I think the INFORMIXDIR is set Windows like. But see yourself. Perhaps there > is an other environment entry you see. > > regards, > Dirk nope, not a sausage. Stupid question - have you tried CSDK 32bits? same issues? -- Ciao, Marco ______________________________________________________________________________ Marco Greco /UK /IBM Standard disclaimers apply! Structured Query Scripting Language http://www.4glworks.com/sqsl.htm 4glworks http://www.4glworks.com Informix on Linux http://www.4glworks.com/ifmxlinux.htm