esql/c error LNK1136: invalid or corrupt file
Posted in 2000
A beginner on Windows NT (IDS 9.14, CSDK 2.0) got linker error LNK1136 "invalid or corrupt file" when building with esql, because he passed the header d:\\informix\\incl\\dmi\\mi.h with the -l (library) flag, so the linker tried to treat a text header as an object/library. Replies explained that headers need -I with just the directory (-Id:\\informix\\incl\\dmi), and that the DataBlade library d:\\informix\\lib\\dmi\\libthdmi.lib must be listed after the source file to resolve the externals. That cleared the error, leaving the poster with only four unresolved symbols.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
Hello newsgroup: Can anyone help me figure out the problem with my "mi.h" file? Using the command line utilities, I type: esql -o gipsy.exe -l d:\\informix\\incl\\dmi\\mi.h d:\\gipsy\\illustra\\gispy.exe and get the following error from the linker: -OUT:gipsy.exe -MAP -SUBSYSTEM:CONSOLE gipsy_funcs.obj d:\\informix\\incl\\dmi\\mi.h D:\\INFORMIX\\lib\\isqlt09a.lib D:\\INFORMIX\\lib\\igl4n304.lib D:\\INFORMIX\\lib\\iglxn304.lib D:\\INFORMIX\\lilb\\igo4n304.lib netapi32.lib wsock32.lib user32.lib winmm.lib d:\\informix\\incl\\dmi\\mi.h : fatal error LNK1136: invalid or corrupt file esql: error -55904: Error in spawned program The file "d:\\informix\\incl\\dmi\\mi.h" exists on my system, and appears to be ok (when I view it in a text editor). Sincerely, Andrew Smith
I am using Informix IDS 9.14 with CSDK 2.0 on a Windows NT machine running service pack 6. Sorry for the omission in the original posting... Sincerely, Andrew -- Andrew Smith sandrew@ucsu.colorado.edu
In article <88800n$eah$1@peabody.colorado.edu>, Andrew Smith <sandrew@ucsu.colorado.edu> writes >I am using Informix IDS 9.14 with CSDK 2.0 on a Windows NT machine running >service pack 6. > Is NT Service Pack 6 out yet?? Last I heard Informix had been ported to Service Pack 4 and that was only a couple of months ago! >Sorry for the omission in the original posting... > >Sincerely, >Andrew >-- >Andrew Smith >sandrew@ucsu.colorado.edu > > -- David Williams
David Williams wrote: > Andrew Smith <sandrew@ucsu.colorado.edu> writes > >I am using Informix IDS 9.14 with CSDK 2.0 on a Windows NT machine running > >service pack 6. > > Is NT Service Pack 6 out yet?? Yes; there's also a SP6A! -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v0.95 -- see http://www.perl.com/CPAN #include <disclaimer.h>
Well, my frustrations continue... Why am I even pointing esql to this library when it is specified as an #include file in the C code? When I do specify the include directory using the 'esql' command, I am back to square one and I get all the 'unresolved external errors' again. How do I properly configure my system\\informix\\program to locate the "mi.h" file? What is the proper syntax for the C code? This is not intuitive or user friendly!!! Sincerely, Andrew Smith -----Original Message----- From: Erik van Veen <evanveen@pacbell.net> To: 'sandrew@ucsu.colorado.edu' <sandrew@ucsu.Colorado.EDU> Date: Tuesday, February 15, 2000 11:06 PM Subject: Re: esql/c error LNK1136: invalid or corrupt file > >On my sceen, it looks like you're trying the pass off an include file >(mi.h) as a linker file. If you want to point ESQL/C to the location of the >'mi.h' file, use 'esql ... -I d:\\informix\\incl\\dmi', (that's an '-I' as in >'capital i', and just the directory). >As you appear the be using an 'l' (as in lowercase 'L'), the compiler is >expecting an object or libary, not a plain text file.
Your ESQL command line needs to have both -I d:\\informix\\incl\\dmi and d:\\informix\\lib\\dmi\\libthdmi.lib. By the way, unless you are porting some blade code to the client, the recommended C/C++ APIs are ESQL, ODBC and OLEDB. Leopold Andrew Smith <sandrew@ucsu.colorado.edu> wrote in message news:88f4te$t9c$1@peabody.colorado.edu... > Well, my frustrations continue... Why am I even pointing esql to this > library when it is specified as an #include file in the C code? When I do > specify the include directory using the 'esql' command, I am back to square > one and I get all the 'unresolved external errors' again. How do I properly > configure my system\\informix\\program to locate the "mi.h" file? What is the > proper syntax for the C code? This is not intuitive or user friendly!!! > > Sincerely, > Andrew Smith > > -----Original Message----- > From: Erik van Veen <evanveen@pacbell.net> > To: 'sandrew@ucsu.colorado.edu' <sandrew@ucsu.Colorado.EDU> > Date: Tuesday, February 15, 2000 11:06 PM > Subject: Re: esql/c error LNK1136: invalid or corrupt file > > > > > >On my sceen, it looks like you're trying the pass off an include file > >(mi.h) as a linker file. If you want to point ESQL/C to the location of the > >'mi.h' file, use 'esql ... -I d:\\informix\\incl\\dmi', (that's an '-I' as in > >'capital i', and just the directory). > >As you appear the be using an 'l' (as in lowercase 'L'), the compiler is > >expecting an object or libary, not a plain text file. > > >
-----Original Message----- From: Leopold The Cat <leopold_the_cat@yahoo.com> Newsgroups: comp.databases.informix Date: Wednesday, February 16, 2000 3:36 PM Subject: Re: esql/c error LNK1136: invalid or corrupt file Your ESQL command line needs to have both -I d:\\informix\\incl\\dmi and d:\\informix\\lib\\dmi\\libthdmi.lib. By the way, unless you are porting some blade code to the client, the recommended C/C++ APIs are ESQL, ODBC and OLEDB. Leopold Andrew Smith <sandrew@ucsu.colorado.edu> wrote in message news:88f4te$t9c$1@peabody.colorado.edu... > Well, my frustrations continue... Why am I even pointing esql to this > library when it is specified as an #include file in the C code? When I do > specify the include directory using the 'esql' command, I am back to square > one and I get all the 'unresolved external errors' again. How do I properly > configure my system\\informix\\program to locate the "mi.h" file? What is the > proper syntax for the C code? This is not intuitive or user friendly!!! > > Sincerely, > Andrew Smith > > -----Original Message----- > From: Erik van Veen <evanveen@pacbell.net> > To: 'sandrew@ucsu.colorado.edu' <sandrew@ucsu.Colorado.EDU> > Date: Tuesday, February 15, 2000 11:06 PM > Subject: Re: esql/c error LNK1136: invalid or corrupt file > > > > > >On my sceen, it looks like you're trying the pass off an include file > >(mi.h) as a linker file. If you want to point ESQL/C to the location of the > >'mi.h' file, use 'esql ... -I d:\\informix\\incl\\dmi', (that's an '-I' as in > >'capital i', and just the directory). > >As you appear the be using an 'l' (as in lowercase 'L'), the compiler is > >expecting an object or libary, not a plain text file.>
Leopold, Thanks for your response. I am still unclear about how to write my command line. Are you suggesting that I type: esql -o gipsy.exe -I d:\\informix\\incl\\dmi -I d:\\informix\\lib\\dmi\\libthdmi.lib <pathname to source code> -or- esql -o gipsy.exe -Ld:\\informix\\lib\\dmi\\libthdmi.lib -Id:\\informix\\incl\\dmi <pathname to source code> I have been told to omit the space between the flag and the pathname, and how do I know when to include the actual filename and when to just type the pathname of the directory? Because I am so green, I do not understand the last bit of your message. Do I need to configure these APIs on my computer? Sincerely, Andrew Smith -----Original Message----- From: Leopold The Cat <leopold_the_cat@yahoo.com> Newsgroups: comp.databases.informix Date: Wednesday, February 16, 2000 3:36 PM Subject: Re: esql/c error LNK1136: invalid or corrupt file >Your ESQL command line needs to have both -I d:\\informix\\incl\\dmi and >d:\\informix\\lib\\dmi\\libthdmi.lib. By the way, unless you are porting some >blade code to the client, the recommended C/C++ APIs are ESQL, ODBC and >OLEDB. > >Leopold
esql -o gipsy.exe -Id:\\informix\\incl\\dmi <source-filename> d:\\informix\\lib\\dmi\\libthdmi.lib Andrew Smith <sandrew@ucsu.colorado.edu> wrote in message news:88fobg$gvl$1@peabody.colorado.edu... > Leopold, > > Thanks for your response. I am still unclear about how to write my command > line. Are you suggesting that I type: > > esql -o gipsy.exe -I d:\\informix\\incl\\dmi -I > d:\\informix\\lib\\dmi\\libthdmi.lib <pathname to source code> > > -or- > > esql -o gipsy.exe -Ld:\\informix\\lib\\dmi\\libthdmi.lib -Id:\\informix\\incl\\dmi > <pathname to source code> > > I have been told to omit the space between the flag and the pathname, and > how do I know when to include the actual filename and when to just type the > pathname of the directory? Because I am so green, I do not understand the > last bit of your message. Do I need to configure these APIs on my computer? > > Sincerely, > Andrew Smith > > -----Original Message----- > From: Leopold The Cat <leopold_the_cat@yahoo.com> > Newsgroups: comp.databases.informix > Date: Wednesday, February 16, 2000 3:36 PM > Subject: Re: esql/c error LNK1136: invalid or corrupt file > > > >Your ESQL command line needs to have both -I d:\\informix\\incl\\dmi and > >d:\\informix\\lib\\dmi\\libthdmi.lib. By the way, unless you are porting some > >blade code to the client, the recommended C/C++ APIs are ESQL, ODBC and > >OLEDB. > > > >Leopold > > >
Thanks again, Leopold! I am now down to 4 'unresolved externals'! Baby steps... Andrew.