List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:September 19 1999 9:54pm
Subject:Re: MyODBC compilation
View as plain text  
>>>>> "Steve" == Steve Freitas <sflist@stripped> writes:

>> After I did run configure, make , make install I got:
>> 
>> (/my/local/src/myodbc-2.50.26) ls -lt /usr/local/lib/
>> total 4494
>> -rwxr-xr-x   1 root     root          609 Sep 19 21:37 libmyodbc.la
>> -rwxr-xr-x   1 root     root       216424 Sep 19 21:37 libmyodbc-2.50.26.so
>> lrwxrwxrwx   1 root     root           20 Sep 19 21:37 libmyodbc.so -> 
>> libmyodbc-2.50.26.so

Steve> Monty,

Steve> Thanks for the help. Want me to write a docfile about this to throw in 
Steve> with it? I've heard from a lot of people having trouble compiling MyODBC, 
Steve> and I don't think they know to do this.

Steve> Now, it's created libmyodbc.so, but iHTML doesn't seem to be working with 
Steve> it. This is in contrast to another, working copy I have of myodbc called 
Steve> "libmyodbc_mysql.so." (Why am I bothering with this recompile you ask? 
Steve> Well, this 'working copy' I have will only deal with databases hosted on 
Steve> the localhost, and I need to hit another MySQL database on the network.)

Steve> I've checked permissions, and they all look good. The only thing I'm 
Steve> changing between my working and non-working configs is from my test 
Steve> driver to this one I've compiled. Any ideas?

Hi!

Here is some more information:

When you link libmyodbc.so it should work if you have the shared library 
libmysqlclient.so.  If you don't have this, you will get the following 
error message:

/bin/sh ./libtool --mode=link gcc  -g -O2  -o libmyodbc.la -rpath /usr/local//lib -release
2.50.26  list.lo catalog.lo connect.lo dll.lo execute.lo info.lo myodbc.lo options.lo
prepare.lo results.lo transact.lo utility.lo misc.lo -L/usr/local/mysql/lib/mysql
-lmysqlclient -L/usr/local/mysql/lib/mysql
mkdir .libs

*** Warning: This library needs some functionality provided by -lmysqlclient.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have.
*** The inter-library dependencies that have been dropped here will be
*** automatically added whenever a program is linked with this library
*** or is declared to -dlopen it.

gcc -shared  list.lo catalog.lo connect.lo dll.lo execute.lo info.lo myodbc.lo options.lo
prepare.lo results.lo transact.lo utility.lo misc.lo  -L/usr/local/mysql/lib/mysql -lc 
-Wl,-soname -Wl,libmyodbc-2.50.26.so -o .libs/libmyodbc-2.50.26.so
(cd .libs && rm -f libmyodbc.so && ln -s libmyodbc-2.50.26.so
libmyodbc.so)
creating libmyodbc.la
(cd .libs && rm -f libmyodbc.la && ln -s ../libmyodbc.la libmyodbc.la)

I don't know how to fix this properly :(

I managed to get this to work by modifying the above gcc rows slightly
and executing:

gcc -shared  list.lo catalog.lo connect.lo dll.lo execute.lo info.lo myodbc.lo options.lo
prepare.lo results.lo transact.lo utility.lo misc.lo  -L/usr/local/mysql/lib/mysql -lc 
-Wl,-soname -Wl,libmyodbc-2.50.26.so -o .libs/libmyodbc-2.50.26.so
-L/usr/local/mysql/lib/mysql -lmysqlclient

After a make install I can do:

$ cd libiodbc-2.50.3/samples
$ odbctest DSN=test
OpenLink ODBC Demonstration program
This program shows an interactive SQL processor


SQL>select VERSION();
VERSION()
------------------
3.23.4-alpha-debug
 1 row(s) fetched.
                                 
SQL>quit

Have a nice day.

Here is my ~/.odbc.ini file:

#=============================================================================#
# iodbc.ini (Unix)                                                            #
#									      #
# Copy this to ~/.odbc.ini and you can access the test database		      #
# with 'SAMPLES/odbctest						      #
#=============================================================================#
#                                                                             #
# sample configuration file for iODBC                                         #
#                                                                             #
#-----------------------------------------------------------------------------#
#                                                                             #
# a driver section is set up like this:                                       #
#       [<identifier>]                                                        #
#               Driver = <path>/<name_of_dynamic_link_library>               
#
#               DSN    = <database_name>                                      #
#                                                                             #
# <identifier>  ::= [A-za-z][A-Za-z0-9_]*                                     #
#  [default]    ::= entry used, if no other data matches                      #
#                                                                             #
# Trace = ON | On | on | 1 | OFF | Off | off | 0                              #
#       enable tracing of ODBC routines                                       #
# Tracefile = stdout | stderr                                                 #
#       output for trace information, either stdout or stderr                 #
#                                                                             #
# Some MySQL specific options:						      #
#                                                                             #
# SERVER = hostname of server that runs mysqld				      #
# PORT   = TCP/IP port (default 3306)					      #
# SOCKET = Unix socket to use as connection if SERVER is not given or if      #
#	   SERVER is 'localhost'					      #
# DB	 = Database to connect to. If not given, DSN is used.		      #
#          This allows one to access databases with the same name on	      #
#	   different machines.						      #
# OPTION = Changes behavour of MyDOBC for not ODBC compilant clients.	      #
#          See the myodbc README file for more information.                   #
#                                                                             #
#=============================================================================#

#
# MySQL specific:
# If DB is given it's used as the databasename instead of DNS.
# 
#

[test]
Trace    = Off
TraceFile= stderr
Driver   = /usr/local/lib/libmyodbc.so
DSN      = test
SERVER   = localhost 
USER     = test
PASSWORD = 
PORT     = 3306 
#OPTIONS = 1
#DATABASE= test
#SOCKET  = /tmp/mysql.sock

#=============================================================================#
# end of file                                                                 #
#=============================================================================#

Hope the above helps!

Regards,
Monty


Thread
MyODBC compilationMichael Widenius18 Sep
Re: MyODBC compilationChristopher R. Jones18 Sep
Re: MyODBC compilationSteve Freitas19 Sep
Re: MyODBC compilationMichael Widenius19 Sep
Re: MyODBC compilationSteve Freitas19 Sep
Re: MyODBC compilationMichael Widenius19 Sep
Re: MyODBC compilationSteve Freitas20 Sep
Re: MyODBC compilationMichael Widenius20 Sep
Re: MyODBC compilationSteve Freitas21 Sep
Re: MyODBC compilationMichael Widenius21 Sep
Re: MyODBC compilationSteve Freitas22 Sep
Re: MyODBC compilationSteve Freitas22 Sep
Re: MyODBC compilationMichael Widenius22 Sep
Re: MyODBC compilationSteve Freitas23 Sep
Re: MyODBC compilationMichael Widenius23 Sep
Re: MyODBC compilationSteve Freitas23 Sep
Re: MyODBC compilationSteve Freitas25 Sep
Re: MyODBC compilationSteve Freitas26 Sep