Hello Guys,

I'm trying to pin-point the problem we have compiling ruby-odbc 0.9995
with latest (p111) release of 1.8.6.

Part of the mkmf.log file:

have_library_ex: checking for SQLAllocConnect() in -lodbc32...
-------------------- no

"cl -nologo -Feconftest -I.
-ID:/Users/Developer/code/OpenSource/installer-trunk/ruby/lib/ruby/1.8/i386-mswin32
-I. -ID:/Users/Developer/code/OpenSource/installer-trunk/ruby/lib/ruby/1.8/i386-mswin32
 -MD -Zi -O2b2xg- -G6 conftest.c   msvcrt-ruby18-static.lib odbc32.lib
 oldnames.lib user32.lib advapi32.lib ws2_32.lib   -link
-libpath:"." -libpath:"D:/Users/Developer/code/OpenSource/installer-trunk/ruby/lib"
-stack:0x2000000"
conftest.c
conftest.obj : error LNK2001: unresolved external symbol _SQLAllocConnect
conftest.exe : fatal error LNK1120: 1 unresolved externals
checked program was:
/* begin */
1: #define WIN32_LEAN_AND_MEAN
2: #include <winsock2.h>
3: #include <windows.h>
4: #include <sql.h>
5:
6: /*top*/
7: int main() { return 0; }
8: int t() { void ((*volatile p)()); p = (void
((*)()))SQLAllocConnect; return 0; }
/* end */

====

Taking that C program as example, I tried to find the problem, and
reduced to just the WIN32_LEAN_AND_MEAN definition.

Without it, sample C compiles just fine.

mkmf builds the COMMON_HEADERS from Config::CONFIG['COMMON_MACROS']
and Config::CONFIG['COMMON_HEADERS'] values.

===

Curt commented that previous compilation of Ruby/ODBC was without
problems (1.8.5), so I was thinking:

A) Maybe this was introduced in mkmf.rb in latest 1.8.6.
B) The compilation of latest p111 added the define to rbconfig.rb
C) Or just Ruby/ODBC is broken and need a custom way to find that function.

I'll really appreciate some points on how create the custom function
evaluation from extconf, so maybe I could provide a patch to the
author.

(Tried looking at mkmf.rb but is not well documented how to use
try_func or try_link with a custom script).

Thanks in advance,

-- 
Luis Lavena
Multimedia systems
-
Leaders are made, they are not born. They are made by hard effort,
which is the price which all of us must pay to achieve any goal that
is worthwhile.
Vince Lombardi