Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
C:\PROGRA~2\IBM\Informix\11.70\bin\ESQL.EXE -c -IC:\PROGRA~2 +\IBM\Informix\11.70/incl/esql -IC:\Perl\lib/auto/DBI -IC:\Perl\site\l +ib/auto/DBI -I/auto/DBI -IC:\Perl\site\lib/auto/DBI -cc -nologo -GF -W3 -MD -Zi - +DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DNO_HAS +H_SEED -DUS E_SITECUSTOMIZE -DPRIVLIB_LAST_IN_INC -DPERL_IMPLICIT_CONTEXT -DPERL_I +MPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX -MD -Zi -DNDEBUG -O1 + -DVERSIO N=\"2011.0612\" -DXS_VERSION=\"2011.0612\" -IC:\Perl\lib\CORE -DESQL +C_VERSION=370 -DNDEBUG -DDO_NOT_USE_STDERR_H -DESQLC_IFX_LOC_T sqltyp IBM Informix CSDK Version 3.70, IBM Informix-ESQL Version 3.70.TC5 sqltype.c : warning C4013: 'snprintf' undefined; assuming extern + returning int
Somewhere in the headers for (what is a .ec?) you are missing a declaration for snprintf. How I diagnose this is the following, you need to create a .i post preprocessor file. For most CPAN modules a "nmake nameofCfile.i" will make a .i. Then, this is optional but recommended so your eyes dont bleed, send the .i file through a C code formatter, I use Then open the .i file in a code editor, for a search for ALL mentions of snprintf (the function name). For a typical CPAN module using my VS 2003, I got the following for snprintf.
#line 279 "C:\\Program Files\\Microsoft Visual Studio .NET 2003\\VC7\\ +INCLUDE\\stdio.h" __declspec(dllimport) int __cdecl _flushall(void); __declspec(dllimport) FILE * __cdecl fopen(const char *, const char *) +; __declspec(dllimport) int __cdecl fprintf(FILE *, const char *, ...); __declspec(dllimport) int __cdecl fputc(int, FILE *); __declspec(dllimport) int __cdecl _fputchar(int); __declspec(dllimport) int __cdecl fputs(const char *, FILE *); __declspec(dllimport) size_t __cdecl fread(void *, size_t, size_t, FIL +E *); __declspec(dllimport) FILE * __cdecl freopen(const char *, const char +*, FILE *); __declspec(dllimport) int __cdecl fscanf(FILE *, const char *, ...); __declspec(dllimport) int __cdecl fsetpos(FILE *, const fpos_t *); __declspec(dllimport) int __cdecl fseek(FILE *, long, int); __declspec(dllimport) long __cdecl ftell(FILE *); __declspec(dllimport) size_t __cdecl fwrite(const void *, size_t, size +_t, FILE *); __declspec(dllimport) int __cdecl getc(FILE *); __declspec(dllimport) int __cdecl getchar(void); __declspec(dllimport) int __cdecl _getmaxstdio(void); __declspec(dllimport) char * __cdecl gets(char *); __declspec(dllimport) int __cdecl _getw(FILE *); __declspec(dllimport) void __cdecl perror(const char *); __declspec(dllimport) int __cdecl _pclose(FILE *); __declspec(dllimport) FILE * __cdecl _popen(const char *, const char * +); __declspec(dllimport) int __cdecl printf(const char *, ...); __declspec(dllimport) int __cdecl putc(int, FILE *); __declspec(dllimport) int __cdecl putchar(int); __declspec(dllimport) int __cdecl puts(const char *); __declspec(dllimport) int __cdecl _putw(int, FILE *); __declspec(dllimport) int __cdecl remove(const char *); __declspec(dllimport) int __cdecl rename(const char *, const char *); __declspec(dllimport) void __cdecl rewind(FILE *); __declspec(dllimport) int __cdecl _rmtmp(void); __declspec(dllimport) int __cdecl scanf(const char *, ...); __declspec(dllimport) void __cdecl setbuf(FILE *, char *); __declspec(dllimport) int __cdecl _setmaxstdio(int); __declspec(dllimport) int __cdecl setvbuf(FILE *, char *, int, size_t) +; __declspec(dllimport) int __cdecl _snprintf(char *, size_t, const char + *, ...); __declspec(dllimport) int __cdecl sprintf(char *, const char *, ...); __declspec(dllimport) int __cdecl _scprintf(const char *, ...); __declspec(dllimport) int __cdecl sscanf(const char *, const char *, . +..); __declspec(dllimport) int __cdecl _snscanf(const char *, size_t, const + char *, ...); __declspec(dllimport) char * __cdecl _tempnam(const char *, const char + *); __declspec(dllimport) FILE * __cdecl tmpfile(void); __declspec(dllimport) char * __cdecl tmpnam(char *); __declspec(dllimport) int __cdecl ungetc(int, FILE *); __declspec(dllimport) int __cdecl _unlink(const char *); __declspec(dllimport) int __cdecl vfprintf(FILE *, const char *, va_li +st); __declspec(dllimport) int __cdecl vprintf(const char *, va_list); __declspec(dllimport) int __cdecl _vsnprintf(char *, size_t, const cha +r *, va_list); __declspec(dllimport) int __cdecl vsprintf(char *, const char *, va_li +st); __declspec(dllimport) int __cdecl _vscprintf(const char *, va_list); ---------------CUT----------------- #line 1 "c:\\perl517\\lib\\core\\proto.h" ---------------CUT----------------- //still in proto.h __declspec(dllimport) void Perl_my_setenv( PerlInterpreter* my_perl + , const char* nam, const char* val); __declspec(dllimport) int Perl_my_snprintf(char *buffer, const size +_t len, const char *format, ...) ; ------------------------CUT----------------------- //still in proto.h I think __declspec(dllimport) I32 Perl_my_stat_flags( PerlInterpreter* my_p +erl , const U32 flags); __declspec(dllimport) char * Perl_my_strftime( PerlInterpreter* my_ +perl , const char *fmt, int sec, int min, int hour, int mday, int mon +, int year, int wday, int yday, int isdst) ; __declspec(dllimport) void Perl_my_swabn(void* ptr, int n) ; __declspec(dllimport) void Perl_my_unexec( PerlInterpreter* my_perl + ); __declspec(dllimport) int Perl_my_vsnprintf(char *buffer, const siz +e_t len, const char *format, va_list ap) ;
The lack of the header declaration, and that ALONE, is what caused the "assuming extern returning int" error. My VS 2008 also doesn't have a snprintf. The problem now is, do we get a snprintf? comment out where it is used? Write one from scratch? write a dummy that just returns? copy paste from another FOSS project? find an equivalent under another name? look for an undocumented MS CRT DLL export?

First lets look and see if the Perl interp has a work around. Grepping /Windows search the perl interp source code, reveals this line, win32/win32.h#l207 in perl.git
196 #ifdef _MSC_VER /* Microsoft Visual C++ */ 197 198 #ifndef UNDER_CE 199 typedef long uid_t; 200 typedef long gid_t; 201 typedef unsigned short mode_t; 202 #endif 203 204 #pragma warning(disable: 4102) /* "unreferenced label" */ 205 206 #define isnan _isnan 207 #define snprintf _snprintf 208 #define vsnprintf _vsnprintf 209 210 #if _MSC_VER < 1300 211 /* VC6 has broken NaN semantics: NaN == NaN returns true instead +of false */ 212 #define NAN_COMPARE_BROKEN 1 213 #endif 214 215 #endif /* _MSC_VER */
I guess that is the best thing to try. Since I dont know the headers/includes in sqltype/.c/.ec files are I can't tell you if sqltype is perl-aware (has EXTERN.h, perl.h, XSUB.h) or not. If it is perl aware, it should have gotten that redefinition, and if that redefinition didn't happen yet the compiland is perl aware that is a different problem to trouble shoot.

Since _snprintf is in msvcrt.lib and msvcrt.lib is on the cmd line to link, the link will work then.
link -out:blib\arch\auto\DBD\Informix\Informix.dll -dll -nolog +o -nodefaultlib -debug -opt:ref,icf -libpath:"C:\Perl\lib\CORE" -ma +chine:x86 I nformix.obj dbdimp.obj dbdattr.obj sqltoken.obj sqltype.obj ixblob.obj + odbctype.obj kludge.obj link.obj esqlcver.obj esqlc_v6.obj /LIBPATH: +C:\PROGRA~2 \IBM\Informix\11.70/lib /LIBPATH:C:\PROGRA~2\IBM\Informix\11.70/lib/es +ql "C:/PROGRA~2/IBM/Informix/11.70\lib\isqlt09a.lib" "C:/PROGR +A~2/IBM/Inf ormix/11.70\lib\igl4n304.lib" "C:/PROGRA~2/IBM/Informix/11.70\lib\iglx +n304.lib" "C:/PROGRA~2/IBM/Informix/11.70\lib\igo4n304.lib" netapi32. +lib wsock32 .lib user32.lib winmm.lib advapi32.lib C:\Perl\lib\CORE\perl58.lib ol +dnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.l +ib advapi32 .lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib ws2_32. +lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msvcrt.lib + -def:Infor mix.def Creating library blib\arch\auto\DBD\Informix\Informix.lib and objec +t blib\arch\auto\DBD\Informix\Informix.exp sqltype.obj : error LNK2019: unresolved external symbol _snprintf refe +renced in function _sqltypename ixblob.obj : error LNK2019: unresolved external symbol _mkstemp refere +nced in function _blob_locinanonfile blib\arch\auto\DBD\Informix\Informix.dll : fatal error LNK1120: 2 unre +solved externals NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual S +tudio 10.0\VC\BIN\link.EXE"' : return code '0x460' Stop.
The "ixblob.obj : error LNK2019: unresolved external symbol _mkstemp referenced in function _blob_locinanonfile" error will be more difficult to diagnose. Again looking through a typical CPAN module .i file I see.
#line 280 "c:\\perl517\\lib\\core\\win32.h" extern char * getlogin(void); extern int chown(const char *p, uid_t o, gid_t g); extern int mkstemp(const char *path); __declspec(dllimport) void Perl_win32_init(int *argcp, char *** +argvp); __declspec(dllimport) void Perl_win32_term(void); __declspec(dllimport) void Perl_init_os_extras(void); __declspec(dllimport) void win32_str_os_error(void *sv, DWORD e +rr); __declspec(dllimport) int RunPerl(int argc, char **argv, char * +*env);
Thats really interesting. That is the 1 and only mention of mkstemp in the .i file. I look at export list of msvcr100.dll (happens to be on my screen), no mkstemp or _mkstemp, I also looked at export list of perl517.dll (my perl). Its a bug with the perl interp. Perl declares a mkstemp at win32/win32.h#l282 in perl.git, but Perl's internal mkstemp at win32/win32.c#l1089 in perl.git isn't exported, so that badly suppressed another "assuming extern returning int" you should have gotten. I'm off to file another RT bug now.

In reply to Re^2: Problem Installing DBD::Informix on Windows 7 using AS Perl 5.8.9 by bulk88
in thread Problem Installing DBD::Informix on Windows 7 using AS Perl 5.8.9 by roho

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others scrutinizing the Monastery: (4)
    As of 2020-02-17 09:15 GMT
    Find Nodes?
      Voting Booth?
      What numbers are you going to focus on primarily in 2020?

      Results (71 votes). Check out past polls.