Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2005

    Unanswered: OCCI linking problems under RH Linux


    I am new to OCCI and try to get started by trying to compile the following
    trivial source under Red Hat Enterprise Linux ES release 3 with
    gcc-3.2.3 and Oracle 10g:

    #include <occi.h>

    using namespace oracle:cci;

    int main() {
    Environment *env = Environment::createEnvironment();
    Connection *conn = env->createConnection("user", "pw");


    rowlf:[OracleTesting]> g++ -o occitest -lclntsh -locci
    /tmp/ccvh59LW.o(.text+0x22): In function `main':
    : undefined reference to `oracle:cci::Environment::createEnvironment(oracle:cci::Environment::Mode, void*, void* (*)(void*, unsigned), void* (*)(void*, void*, unsigned), void (*)(void*, void*))'
    /tmp/ccvh59LW.o(.text+0x1e9): In function `main':
    : undefined reference to `oracle:cci::Environment::terminateEnvironment(oracle:cci::Environment*)'
    collect2: ld returned 1 exit status

    Does anybody know what is wrong here?
    I noted that a very similar problem was posted here in July last year where the conclusion was that the Oracle OCCI libs in 9i could not be used with
    gcc-3.x (because the name mangling scheme changed from 2.95.x -> 3.x).
    However, I am using 10g where this should not be an issue any more ...


  2. #2
    Join Date
    Aug 2003
    Where the Surf Meets the Turf @Del Mar, CA
    Provided Answers: 1
    $ORACLE_HOME/rdbms/demo has a handful of OCI examples in it.
    You might want to start with one of them before you try rolling your own code.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Aug 2004
    I think that you have to include the directory where the header files (.h) lie in your compile command. Sorry but I don't know the command with g++. With CC the option is -I. Obviously it does not find "occi.h".

    BTW anacedent, there cannot be a simpler OCCI code, and the examples shipped with Oracle are awful to compile and use. I never used them myself .

    Astrodb, don't hesitate to ask other questions, I know how hard it is to start using OCCI .

    HTH & Regards,


Posting Permissions

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