Results 1 to 10 of 10
  1. #1
    Join Date
    Jan 2004
    Posts
    6

    Unanswered: OCCI link errors

    Hi,

    I am trying to compile and link the OCCI demo occidml.cpp on Solaris 8 SPARC using gcc 3.3.2 under oracle 9.2.

    The build works fine but the link returns a lot of undefined symbol errors. See the command I run and the output below.

    I ran symfind which comes with oracle (the oracle docs suggest this) to try and track down the symbols but it only returned the libocci.so/.a library which I know is included in linking.

    Does anyone have any ideas on how to get around this?

    Thanks!
    mack2ooo


    make -f demo_rdbms.mk occidml

    /usr/ccs/bin/make -f /apps/oracle/product/9.2.1/rdbms/demo/demo_rdbms.mk buildocci EXE=occidml OBJS=occidml.o

    gcc -c -I/apps/oracle/product/9.2.1/rdbms/demo -I/apps/oracle/product/9.2.1/rdbms/public -I/apps/oracle/product/9.2.1/plsql/public -I/apps/oracle/product/9.2.1/network/public occidml.cpp

    gcc -L/apps/oracle/product/9.2.1/lib/ -L/apps/oracle/product/9.2.1/rdbms/lib/ -o occidml occidml.o -locci -lclntsh `cat /apps/oracle/product/9.2.1/lib/sysliblist` -R/apps/oracle/product/9.2.1/lib -laio -lposix4 -lkstat -lm -lthread

    Undefined first referenced
    symbol in file
    oracle::occi::SQLException::getErrorCode() constoccidml.o
    __1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJal locator4Cc___J__nullref_ /apps/oracle/product/9.2.1/lib//libocci.so
    __1cG__CrunGex_get6F_pv_ /apps/oracle/product/9.2.1/lib//libocci.so
    oracle::occi::Environment::terminateEnvironment(or acle::occi::Environment*)occidml.o
    std::ios_base::Init::~Init [in-charge]()occidml.o
    __1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJal locator4Cc___Gappend6Mrk1_r1_ /apps/oracle/product/9.2.1/lib//libocci.so
    operator new(unsigned) occidml.o
    std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string [in-charge]()occidml.o
    __1c2k6Fpv_v_ /apps/oracle/product/9.2.1/lib//libocci.so
    __1cH__rwstdRexcept_msg_string2t6MIE_v_ /apps/oracle/product/9.2.1/lib//libocci.so
    c::c(n6, (int0_t)) /apps/oracle/product/9.2.1/lib//libocci.so
    __1cG__CrunKex_rethrow6F_v_ /apps/oracle/product/9.2.1/lib//libocci.so
    __1cH__rwstdY__rwse_UnexpectedNullPtr_ /apps/oracle/product/9.2.1/lib//libocci.so
    __1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJal locator4Cc___Gassign6Mrk1II_r1_ /apps/oracle/product/9.2.1/lib//libocci.so
    oracle::occi::SQLException::SQLException[in-charge](oracle::occi::SQLException const&)occidml.o
    __1cG__CrunMex_rethrow_q6F_v_ /apps/oracle/product/9.2.1/lib//libocci.so
    __1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJal locator4Cc___2t6Mpkcrkn0C__v_ /apps/oracle/product/9.2.1/lib//libocci.so
    __1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJal locator4Cc___Hreplace6MIIpkcIII_pc_ /apps/oracle/product/9.2.1/lib//libocci.so
    __1cDstdJbad_allocG__vtbl_ /apps/oracle/product/9.2.1/lib//libocci.so
    std::basic_ostream<char, std::char_traits<char> >::operator<<(std::basic_ostream<char, std::char_traits<char> >& (*)(std::basic_ostream<char, std::char_traits<char> >&))occidml.o
    __cxa_end_catch occidml.o
    std::cout occidml.o
    std::basic_ostream<char, std::char_traits<char> >& std::operator<< <char, std::char_traits<char>, std::allocator<char> >(std::basic_ostream<char, std::char_traits<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)occidml.o
    std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)occidml.o
    __1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJal locator4Cc___2t6Mrk1IIrkn0C__v_ /apps/oracle/product/9.2.1/lib//libocci.so
    __1cDstdLlogic_errorG__vtbl_ /apps/oracle/product/9.2.1/lib//libocci.so
    __1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJal locator4Cc___2G6Mpkc_r1_ /apps/oracle/product/9.2.1/lib//libocci.so
    operator delete(void*) occidml.o
    std::basic_ostream<char, std::char_traits<char> >::operator<<(int)occidml.o
    __1c2K6Fpv_v_ /apps/oracle/product/9.2.1/lib//libocci.so
    c::c(N6, (int0_t)) /apps/oracle/product/9.2.1/lib//libocci.so
    __1cG__CrunKpure_error6F_v_ /apps/oracle/product/9.2.1/lib//libocci.so
    oracle::occi::Environment::createEnvironment(oracl e::occi::Environment::Mode, void*, void* (*)(void*, unsigned), void* (*)(void*, void*, unsigned), void (*)(void*, void*))occidml.o
    std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string[in-charge](std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)occidml.o
    __1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJal locator4Cc___Hcompare6kMIIpkcI_i_ /apps/oracle/product/9.2.1/lib//libocci.so
    __gxx_personality_v0 occidml.o
    __1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJal locator4Cc___2t6MpkcIrkn0C__v_ /apps/oracle/product/9.2.1/lib//libocci.so
    __1cDstdJexceptionG__vtbl_ /apps/oracle/product/9.2.1/lib//libocci.so
    std::allocator<char>::allocator[in-charge]()occidml.o
    __1cDstdLlogic_error2T6M_v_ /apps/oracle/product/9.2.1/lib//libocci.so
    std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)occidml.o
    std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string[in-charge](char const*, std::allocator<char> const&)occidml.o
    __1cG__CrunIex_alloc6FI_pv_ /apps/oracle/product/9.2.1/lib//libocci.so
    oracle::occi::SQLException::~SQLException [in-charge]()occidml.o
    typeinfo for oracle::occi::SQLExceptionoccidml.o
    __1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJal locator4Cc___2G6Mrk1_r1_ /apps/oracle/product/9.2.1/lib//libocci.so
    oracle::occi::SQLException::getMessage() constoccidml.o
    std::ios_base::Init::Init[in-charge]()occidml.o
    __cxa_begin_catch occidml.o
    __1cG__CrunHex_skip6F_b_ /apps/oracle/product/9.2.1/lib//libocci.so
    __1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJal locator4Cc___I__getRep6MII_pnH__rwstdM__string_ref 4Ccn0B_n0C____ /apps/oracle/product/9.2.1/lib//libocci.so
    std::allocator<char>::~allocator [in-charge]()occidml.o
    __1cG__CrunRex_chk_unexpected6F_v_ /apps/oracle/product/9.2.1/lib//libocci.so
    __1cG__CrunIex_clean6F_v_ /apps/oracle/product/9.2.1/lib//libocci.so
    __1cG__CrunIex_throw6Fpvpkn0AQstatic_type_info_pF1 _v_v_ /apps/oracle/product/9.2.1/lib//libocci.so
    ld: fatal: Symbol referencing errors. No output written to occidml
    collect2: ld returned 1 exit status
    *** Error code 1
    make: Fatal error: Command failed for target `buildocci'
    Current working directory /apps/oracle/product/9.2.1/rdbms/demo
    *** Error code 1
    make: Fatal error: Command failed for target `occidml'

  2. #2
    Join Date
    Jan 2004
    Posts
    370
    "I ran symfind which comes with oracle (the oracle docs suggest this) to try and track down the symbols but it only returned the libocci.so/.a library which I know is included in linking."

    Are you saying symfind located the symbols in a library that is included in the link?

    Exactly which symbols did you search for?

    The format makes the output difficult to read, but from the number of missing symbols I can see I'd reckon you're missing at least one library.

  3. #3
    Join Date
    Jan 2004
    Posts
    6
    Originally posted by SkyWriter
    "I ran symfind which comes with oracle (the oracle docs suggest this) to try and track down the symbols but it only returned the libocci.so/.a library which I know is included in linking."

    Are you saying symfind located the symbols in a library that is included in the link?

    Exactly which symbols did you search for?

    The format makes the output difficult to read, but from the number of missing symbols I can see I'd reckon you're missing at least one library.
    I agree that it seems I am missing multiple libraries in my link line. But I can't seem to track down which ones they are and where they reside. For example, see below for a run of symfind on one of the symbols in the error output. It saws that the symbol is found in $ORACLE_HOME/lib/libocci9.a and $ORACLE_HOME/lib/libocci.so. But if you look at the error from linking, it says that is where the unreferenced symbol resides. Any idea what is going on here?

    symfind locator4Cc___J__nullref_

    SymFind - Find Symbol <locator4Cc___J__nullref_> in <**>.a, .o, .so
    ------------------------------------------------------
    Command: /apps/oracle/product/9.2.1/bin/symfind locator4Cc___J__nullref_
    Local Directory: /apps/oracle/product/9.2.1
    Output File: (none)
    Note: I do not traverse symbolic links
    Use '-v' option to show any symbolic links

    Locating Archive and Object files ...
    [54] | 0| 0|NOTY |GLOB |0 |UNDEF |__1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJa llocator4Cc___J__nullref_
    [184] | 0| 0|NOTY |GLOB |0 |UNDEF |__1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJa llocator4Cc___J__nullref_
    [75] | 0| 0|NOTY |GLOB |0 |UNDEF |__1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJa llocator4Cc___J__nullref_
    [56] | 0| 0|NOTY |GLOB |0 |UNDEF |__1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJa llocator4Cc___J__nullref_
    [34] | 0| 0|NOTY |GLOB |0 |UNDEF |__1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJa llocator4Cc___J__nullref_
    [136] | 0| 0|NOTY |GLOB |0 |UNDEF |__1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJa llocator4Cc___J__nullref_
    [157] | 0| 0|NOTY |GLOB |0 |UNDEF |__1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJa llocator4Cc___J__nullref_
    [160] | 0| 0|NOTY |GLOB |0 |UNDEF |__1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJa llocator4Cc___J__nullref_
    [256] | 0| 0|NOTY |GLOB |0 |UNDEF |__1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJa llocator4Cc___J__nullref_
    [166] | 0| 0|NOTY |GLOB |0 |UNDEF |__1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJa llocator4Cc___J__nullref_
    [89] | 0| 0|NOTY |GLOB |0 |UNDEF |__1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJa llocator4Cc___J__nullref_
    [78] | 0| 0|NOTY |GLOB |0 |UNDEF |__1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJa llocator4Cc___J__nullref_
    [73] | 0| 0|NOTY |GLOB |0 |UNDEF |__1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJa llocator4Cc___J__nullref_
    [103] | 0| 0|NOTY |GLOB |0 |UNDEF |__1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJa llocator4Cc___J__nullref_
    [44] | 0| 0|NOTY |GLOB |0 |UNDEF |__1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJa llocator4Cc___J__nullref_
    [39] | 0| 0|NOTY |GLOB |0 |UNDEF |__1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJa llocator4Cc___J__nullref_
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ./lib/libocci9.a
    [1339] | 0| 0|NOTY |GLOB |0 |UNDEF |__1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJa llocator4Cc___J__nullref_
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ./lib/libocci.so

  4. #4
    Join Date
    Jan 2004
    Posts
    370
    The locator4Cc___J__nullref_ is referenced in libocci9.a and libocci.so.
    It is undefined though, the UNDEF value tells you that.

    What is LD_LIBRARY_PATH set to?
    Maybe you're picking up old libraries.

    I don't know where these symbols should reside.
    Sometimes Oracle miss an object from a library, so I'd check for any bugs in that area.

    If there is nothing on metalink then you could take a brute force approach and check the Oracle and system lib directories with something like:

    cd <lib directory>
    nm -A * |grep locator4Cc___J__nullref_

  5. #5
    Join Date
    Jan 2004
    Posts
    6
    >What is LD_LIBRARY_PATH set to?
    >Maybe you're picking up old libraries.

    My LD_LIBRARY_PATH is set in my .cshrc:
    setenv LD_LIBRARY_PATH $ORACLE_HOME/lib:/usr/local/lib:/usr/lib

    which resolves properly to:
    /apps/oracle/product/9.2.1/lib:/usr/local/lib:/usr/lib

  6. #6
    Join Date
    Jan 2004
    Posts
    370
    Is gcc 3.3.2 and Oracle9i on Solaris8 a certified configuration?

  7. #7
    Join Date
    Jan 2004
    Posts
    6
    I have no idea and I have no idea how to find out.

  8. #8
    Join Date
    Jan 2004
    Posts
    370
    The Installation Guide documents all the system requirements.

    The information on compilers for Solaris is here:

    http://download-uk.oracle.com/docs/h....htm#sthref118

    To save you the trouble, here is what is says about Pro*C/C++, 9.2.0.1.0

    Solaris 64-bit Sun Forte Workshop 6.2. 111678-05, 111679-03, 111681-01, 111683-03, 111685-03, 111690-03, 111691-02, 111678-06.
    Note: Solaris 32-bit uses Sun Forte Workshop 6.1.

    Interestingly enough, gcc compiler is certified on Linux:

    Linux GNU gcc 2.95.3

    Maybe version 2.95.3 would work on Solaris too, but it looks like you'd be on your own if you run into problems. According to the manual, Oracle do not certify gcc against 9.2.0.1 on Solaris.

  9. #9
    Join Date
    Jan 2004
    Posts
    6
    Thanks for all of your replies and checking the cert for me.

    I was able to widdle down my errors to the ones below. It ends up that there was an error in the make file and -locci should have been -locci9. Also, I had to link against stdc++ as -lstdc++.

    Now I'm at a point that google turns up a lot on. All conclusions are similar to what you found. It is a problem with compiling using gcc. Supposedly Oracle might fix this soon. And supposedly gcc 2.95.* would compile but I haven't had sucess with that.

    Thanks!
    mack2ooo


    Undefined first referenced
    symbol in file
    oracle::occi::SQLException type_info functionoccidml.o
    oracle::occi::SQLException::getErrorCode(void) constoccidml.o
    oracle::occi::SQLException::SQLException(oracle::o cci::SQLException const &)occidml.o
    oracle::occi::SQLException::getMessage(void) constoccidml.o
    oracle::occi::SQLException::~SQLException(void)occ idml.o
    oracle::occi::Environment::terminateEnvironment(or acle::occi::Environment *) occidml.o
    oracle::occi::Environment::createEnvironment(oracl e::occi::Environment::Mode, void *, void *(*)(void *, unsigned int), void *(*)(void *, void *, unsigned int), void (*)(void *, void *))occidml.o
    ld: fatal: Symbol referencing errors. No output written to occidml
    collect2: ld returned 1 exit status

  10. #10
    Join Date
    Jan 2004
    Posts
    6
    As a final note:

    I installed Sun Workshop 8 CC compiler and the demo compiled and built as is out of the box. I didn't have to make any modifications to the makefile whatsoever with CC.

    mack2ooo

Posting Permissions

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