Results 1 to 4 of 4
  1. #1
    Join Date
    May 2009

    Unanswered: OCCI problems on AIX 5.3 / xlC 9.0


    I'm running into the following problem:

    - I'm using occi to query an Oracle database from C++ code.
    - To this end, I need to specify the "-q64" compiler/linker option (for compiling to 64 bits executables), and the "-locci" linker option (to link the occi library.
    - If I'm using both options, then the C++ program below shows erratic behavior. Instead of the text "This should be printed...", it says "printed...".
    - turning of either of the two options (or both) makes the problem disappear.

    Observe that the program below doesn't make any occi calls. The two compiler/linker options mentioned above are not needed for this program, but they are needed for code that does make occi calls. The program below is just a very small program that triggers the error. A more elaborate program, in which I not only initialize std::string data member and query them, but also do some occi calls, crashes ("segmentation fault/core dumped").

    OS: AIX 5.3
    C++ compiler: xlC 9.0
    Oracle: 9.2

    Included below the C++ code and accompanying Makefile that demonstrate the problem.

    Any pointers into the right direction would be highly appreciated.

    Best regards,

    // occi_test.cpp
    #include <iostream>
    #include <string>
    class A {
      A( const std::string arg ) : m_str ( arg ) {}
      std::string getStr() const { return m_str; } 
      std::string m_str;
    int main()
      A a( "This should be printed..." ); 
      std::cout << a.getStr() << '\n';
      return 0;
    // end of occi_test.cpp

    # Makefile
    # commenting either of the two following lines (or both) solves
    # the problem with the test program, but the options are 
    # required for using occi calls.
    Q64 = -q64
    OCCI_LIB = -locci
    CC = xlC
    OCCI_LIB_DIR = -L/mount/appl00001/oracle920/oraserv920/lib
    LDOPTS =  ${Q64} ${OCCI_LIB_DIR} ${OCCI_LIB}
    CCFLAGS = ${Q64} -c
    OBJ = occi_test.o
    occi_test: ${OBJ}
            ${CC} -o occi_test ${LDOPTS} ${OBJ}
    occi_test.o: occi_test.cpp
            ${CC} ${CCFLAGS} occi_test.cpp
    # end of Makefile

  2. #2
    Join Date
    May 2009
    To follow up on my own post:

    A( const std::string arg ) : m_str ( arg ) {}

    That's a typo; in my actual code, arg is passed by const reference instead of by value (but this doesn't affect the program's symptoms).


  3. #3
    Join Date
    May 2009
    In case anyone googles for this problem: we solved it by upgrading the Oracle client (including occi) to version 10. Appearantly, it was a binary compatibility issue between the occi libraries and the standard c++ libs.


  4. #4
    Join Date
    Aug 2003
    Where the Surf Meets the Turf @Del Mar, CA
    Provided Answers: 1
    THANKS for the follow up post.
    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.

Posting Permissions

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