Can not load ODBC Client. Is it installed? (libodbc.dylib) lazarus / 16-Databases ---------------------------------------------------------------------- jorgealfredoramirez · 2013-10-29 22:41 Hello everyone. Please I need your help!! I spent two days (and nights) trying to resolve this issue. I just migrate from linux to MAC and installed mysql 5.6 and lazarus 1.0.12. When i try to connect with odbc appear the following error: Can not load ODBC Client. Is it installed? (libodbc.dylib) In the folder /usr/lib there is not any libodbc.dylib. The only file is libiodbc.dylib. I installed unixodbc with brew, and in the installation put the file libodbc.dylib in the folder: /usr/local/Cellar/unixodbc/2.3.1/lib When I tested ISQL works fine, but Lazarus still shown the error I tried almost everithing I create links in /usr/libAdd the folder of libodbc to DYLB_LYBRARY_PATHAdd the folder of libodbc to PATHCopy the file libodbc to /usr/ibAnd googled and googled, but nothing... Really appreciate a lot your help! Jorge Ramirez ---------------------------------------------------------------------- jorgealfredoramirez · 2013-10-30 22:08 I am still looking for solution. It seems that "libodbc.dylib" is a dynamic library like *.so in linux. There is a function in Lazarus named : Function LoadLibrary(String) The aim of the function is load dynamic libraries like in Win = *.dll or in Linux = *.so. In Mac = *.dylib If i could understand in which path "LoadLibrary()" is looking for the library "libodbc.dylib" , I can resolve my problem. Any Ideas??? Thank you in advance. Jorge ---------------------------------------------------------------------- jorgealfredoramirez · 2013-10-31 00:25 Well I havent resolve my issue so far  ... I wrote this function to test exactly my error Code: [Select]procedure TForm1.Button1Click(Sender: TObject); var   MyLibC: TLibHandle;   error: String; begin   {MyLibC := LoadLibrary('libodbc.dylib');}   MyLibC := LoadLibrary('libmysqlclient.dylib');   error:= GetLoadErrorStr;   Label1.Caption:=error;   if MyLibC = 0 then Exit; end;  And got the following statement 'dlopen(libodbc.dylib, 1): no suitable image found.  Did find: /usr/local/lib/libodbc.dylib: mach-o, but wrong architecture /usr/lib/libodbc.dylib: mach-o, but wrong architecture' I was looking for a solution but... I do not believe is so dificult connect Lazarus with mysql in Mac OS If you have some hint... Please help ---------------------------------------------------------------------- engkin · 2013-10-31 00:41 Congrats!. You answered your own question regarding where to put your library, then you found your real problem wrong architecture. Are you using 64 bit or 32 bit? is it for Intel CPU or Motorola's? ---------------------------------------------------------------------- jorgealfredoramirez · 2013-10-31 02:55 Just for the record... After three days of research. Finally I found a workaround. The problem: When Lazarus 1.0.12 running in a Mac OS 10.8 tried to connect to MySQL 5.6 thought ODBC it doesnt work the compiler only shows the following error : Can not load ODBC Client. Is it installed? (libodbc.dylib) The error seems to be a path problem, or a missing file. The Research: There is a standard function in C named LoadLibrary, in lazarus I used it with the unit dynlibs. Also in the same unit there is a function to catch the error, named GetLoadErrorStr, so I  created a little program to catch the real error, and was: 'dlopen(libodbc.dylib, 1): no suitable image found.  Did find: /usr/local/lib/libodbc.dylib: mach-o, but wrong architecture /usr/lib/libodbc.dylib: mach-o, but wrong architecture' The error was a problem with architecture, not path or missing file. In the research I found that Lazarus 1.0.12 only run in 32 bites even if it is running over mac os 64 bits ... so weird!!.. Workaround: Change my mind and instead of use ODBC, I used mysql55conn unit, so I have to download the mysql-5.5.34-osx10.6-x86.tar.gz 32 bits of course and copy only de lib files to /usr/local/lib. And work fine until now... In the future I need to looking for download and install unixodbc 32 bits, but for now I will work with this workaround. If you know a better solution please let me know. Regards Jorge ps. Sorry for my bad English...