Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2003
    Posts
    8

    Unanswered: error while connecting to sybase from c code...

    I tried connection to the sybase db using the examples in the sybase/system/OSC-12_5/samples/ctlibrary.
    I could load the dylibs by copying the dylibs into the /usr/lib, where the program was searching for dynamic libraraies.
    But with the first context alloc I recieved a error saying:

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

    Cannot access the sybase home directory, please check environment variable SYBASE or ~sybase
    Fatal error: cs_ctx_alloc failed
    in main
    TestingSybaseCt has exited with status 1.

    any one help....
    I had already set the sybase home directory path in the env, and the localization files (in /locales are given full permission)
    -ravi

  2. #2
    Join Date
    Jan 2003
    Location
    Geneva, Switzerland
    Posts
    353
    Instead of copying the library files, you should source the SYBASE.sh (or SYBASE.csh, if you are using C-Shell) from the root directory of the Sybase installation.
    From your post you seem to be using MacOSX, so I don't know the default location of the Sybase install.
    Note that the "context allocation failed" error is usually due to one or more incorrect environment variables. In your case I would guess that the SYBASE env. variable either isn't set, or doesn't point to the root directory of the Sybase install.

    Michael

  3. #3
    Join Date
    Dec 2003
    Posts
    8

    Unhappy unable to establish sybase connection yet????

    Originally posted by mpeppler
    Instead of copying the library files, you should source the SYBASE.sh (or SYBASE.csh, if you are using C-Shell) from the root directory of the Sybase installation.
    From your post you seem to be using MacOSX, so I don't know the default location of the Sybase install.
    Note that the "context allocation failed" error is usually due to one or more incorrect environment variables. In your case I would guess that the SYBASE env. variable either isn't set, or doesn't point to the root directory of the Sybase install.

    Michael
    Thanks for that suggestion,
    But my SYBASE.sh file contains the sybase root directory path itself,
    i.e
    SYBASE=/Applications/Sybase/System
    ,and I feel the root directory of the path should be the one pointing to the library, localizations, and other bin file's .am I right?
    stil my system is giving the same error. This time it says,

    dyld: /Users/sunil/TestingSybaseCt/build/TestingSybaseCt.app/Contents/MacOS/TestingSybaseCt can't open library: libcs.dylib (No such file or directory, errno = 2)

    TestingSybaseCt has exited due to signal 5 (SIGTRAP).

    I have not copied the dylibs into /usr/lib folder.That is hy this error was thrown.
    But the env file shows the dyld path to use te dylibs from the sybase folder,i.e

    DYLD_LIBRARY_PATH=/Applications/Sybase/System/OCS-12_5/lib:/usr/lib:
    from the lib folder( which contain the dylib..)
    any help???
    -ravi

  4. #4
    Join Date
    Jan 2003
    Location
    Geneva, Switzerland
    Posts
    353
    The SYBASE.sh file sets the SYBASE, SYBASE_OCS, LD_LIBRARY_PATH (or whatever it's called on MacOSX) - normally if you source that file you should be all set.

    In your case however libcs isn't found - does it exist in $SYBASE/OCS-12_5/lib? If so, is it readable by the process running the test program (i.e. what are the permissions on that file, and on the directory?)

    Michael

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •