[Issue 14787] New: DMD shipps outdated 32-bit ODBC import library

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Jul 8 04:56:10 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=14787

          Issue ID: 14787
           Summary: DMD shipps outdated 32-bit ODBC import library
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: dmitry.olsh at gmail.com

This ODBC test program listed below fails to link due to:
```
 Error 42: Symbol Undefined _SQLSetEnvAttr at 16
odbc.obj(odbc) 
 Error 42: Symbol Undefined _SQLAllocHandle at 12
--- errorlevel 2

```
x64 version works just fine by using MS SDK libraries.

pragma(lib, "odbc32");
import etc.c.odbc.sql;
import etc.c.odbc.sqlext;
import std.stdio;

int main() {
  SQLHENV env;
  SQLCHAR driver[256];
  SQLCHAR attr[256];
  SQLSMALLINT driver_ret;
  SQLSMALLINT attr_ret;
  SQLUSMALLINT direction;
  SQLRETURN ret;

  SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &env);
  SQLSetEnvAttr(env, SQL_ATTR_ODBC_VERSION, cast(void *) SQL_OV_ODBC3, 0);

  direction = SQL_FETCH_FIRST;
  while(SQL_SUCCEEDED(ret = SQLDrivers(env, direction,
                       driver.ptr, driver.sizeof, &driver_ret,
                       attr.ptr, attr.sizeof, &attr_ret))) {
    direction = SQL_FETCH_NEXT;
    printf("%s - %s\n", driver.ptr, attr.ptr);
    if (ret == SQL_SUCCESS_WITH_INFO) printf("\tdata truncation\n");
  }

  return 0;
}

--


More information about the Digitalmars-d-bugs mailing list