Bug #65400 Unresolved APIs in ODBC Connector
Submitted: 23 May 2012 16:51 Modified: 29 May 2012 10:30
Reporter: Keith MacDonald Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:5.1.11 OS:Any
Assigned to: Bogdan Degtyariov CPU Architecture:Any
Tags: ODBC Connector

[23 May 2012 16:51] Keith MacDonald
Description:
I built libmyodbc5 on RHEL 6 as follows:

1. Download and unpack mysql-connector-odbc-5.1.11-src.tar.gz.
2. cd mysql-connector-odbc-5.1.11-src
3. make -f Makefile.am
4. ./configure
5. make
6. make install

I then tried to use it from my application, but got unresolveds which I traced to these source files:

my_prepared_stmt.c
my_stmt.c
parse.c

The solution was to include them in driver/Makefile.am and start again.

How to repeat:
Run any application using MYSQL from ODBC.

Suggested fix:
Include my_prepared_stmt.c, my_stmt.c and parse.c in driver/Makefile.am
[29 May 2012 10:30] Bogdan Degtyariov
Keith, please check the documentation:

http://dev.mysql.com/doc/refman/5.5/en/connector-odbc-installation-source-unix.html

it is a bit obscure as it covers versions before and after 5.1.9.

Earlier versions required running configure script, but 5.1.11 needs cmake.
The example of cmake command line (note that you have to specify -DWITH_UNIXODBC=1 for using UnixODBC, which is more popular than the default
 iODBC):

cmake -DODBC_INCLUDES=/home/dbs/app/unixodbc-2.2.14/include/ -DODBC_LIB_DIR=/home/dbs/app/unixodbc-2.2.14/lib/ -DWITH_UNIXODBC=1 -DCMAKE_INSTALL_PREFIX=/home/dbs/app/myodbc5111 -DMYSQL_INCLUDE_DIR=/home/dbs/app/mysql5524/include/ -DMYSQL_LIB_DIR=/home/dbs/app/mysql5524/lib/
[4 Jul 2012 13:47] Patrick Middleton
Ending support for build setup via configure looks like a bug to me.  Below is the invocation of configure I was using.

env \
  MACOSX_DEPLOYMENT_TARGET=10.4 \
  CFLAGS="-O -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc -mmacosx-version-min=10.4 -no_compact_linkedit, -Wl,-no_compact_linkedit" \
  CXXFLAGS="-O -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc -mmacosx-version-min=10.4 -no_compact_linkedit, -Wl,-no_compact_linkedit" \
  LDFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc -mmacosx-version-min=10.4 -no_compact_linkedit, -Wl,-no_compact_linkedit" \
  CC=/usr/bin/gcc-4.0 \
  CXX=/usr/bin/g++-4.0 \
  ./configure \
  -prefix=/usr/local \
  -disable-dependency-tracking \
  -with-iODBC=/usr/bin/iodbc-config \
  -with-mysql-path=/usr/local \
  -with-iodbc-includes=/Developer/SDKs/MacOSX10.4u.sdk/usr/include \
  -with-iodbc-libs=/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/