about photos bookshelf portfolio blog home
Begin main content

Dealing with random Sybase client on Cygwin problems

For some random reason, all my cygwin software that links with the Sybase client started failing. I determined that when the Sybase dll's were being linked in the SYBASE environment variable is somehow being unset (or ignored) and the default value of c:/sql10 is being used. The tell tale error is:

The context allocation routine failed when it tried to load localization files!! One or more following problems may caused the failure

Your sybase home directory is c:\sql10. Check the environment variable SYBASE if it is not the one you want!
Cannot access file c:\sql10\ini\objectid.dat

I reall have no idea why this is, why it changed or how to fix it. After much searching I decided to use a hacky workaround instead, so here's what I did.

  • I made an empty directory c:\sql10
  • I copied the directories $SYBASE/locales and $SYBASE/charsets into c:\sql10 (these are static lookup data, so they never change unless you upgrade your client software).
  • I created an empty directory c:\sql10\ini
  • I added a line to my .bashrc to copy over the up to date ini data:
    rsync -r /cygdrive/c/SYBASE/ini/ /cygdrive/c/sql10/ini/
Pretty bogus but it works.

02:07 PM, 08 Mar 2006 by Mark Aufflick Permalink

Yet another approach

I've seen same problem, and seems it's gone after we exported SYBASE variable in file c:\cygwin\home\Administrator\.bashrc export SYBASE="C:\\Sybase"

by Unregistered Visitor on 03/12/08

Add comment