CC -xlang=f90 error: undefined reference to `_Qgt'

I am trying to use SS12u1 to build a project in which a C++ main calls f90 subroutines. I compile all the object files separately, with their relevant compilers, and then I try to link with CC -xlang=f90. The result is
tmp$ CC -xlang=f90 test.o doit.o
/opt/SunStudio12u1-Linux-x86-tar-ML/sunstudio12.1/prod/lib/libfsu.a(io.o): In function `Q_GT':
io.c:(.text+0x11b9): undefined reference to `_Qgt'
/opt/SunStudio12u1-Linux-x86-tar-ML/sunstudio12.1/prod/lib/libfsu.a(io.o): In function `Q_GE':
io.c:(.text+0x1205): undefined reference to `_Qge'
/opt/SunStudio12u1-Linux-x86-tar-ML/sunstudio12.1/prod/lib/libfsu.a(io.o): In function `Q_LT':
io.c:(.text+0x1251): undefined reference to `_Qlt'
/opt/SunStudio12u1-Linux-x86-tar-ML/sunstudio12.1/prod/lib/libfsu.a(io.o): In function `Q_SUB':
io.c:(.text+0x12a1): undefined reference to `_Qsub'
/opt/SunStudio12u1-Linux-x86-tar-ML/sunstudio12.1/prod/lib/libfsu.a(io.o): In function `Q_DIV':
io.c:(.text+0x1311): undefined reference to `_Qdiv'
/opt/SunStudio12u1-Linux-x86-tar-ML/sunstudio12.1/prod/lib/libfsu.a(io.o): In function `Q_MUL':
io.c:(.text+0x1381): undefined reference to `_Qmul'
The missing entry points are in libsunquad.a, but placing -lsunquad on the link line doesn't change the behavior.
How can I successfully link?

The problem you describe is a bug in the CC driver. Please
report the bug.
You are correct that the program needs to link with the
library libsunquad.a. The easiest workaround is probably
to spell out the full pathname for libsunquad.a on the
link line.
Bob Corbett

Similar Messages

  • Linker error «error: undefined reference to '__ZN7problemC1Ev'»

    Here's some code I have been trying to compile all day and having gotten a cryptic linker error that I can't figure out.
    First here is my Makefile:
    T09: check
      @echo "-------- problem --------"
      "$(FLASCC)/usr/bin/g++" $(BASE_CFLAGS) main.cpp -swf-size=960x540 -emit-swf -o problem.swf -lAS3++ -lFlash++
    include ../Makefile.common
    clean:
      rm -f *.swf
    main.cpp
    #include "AS3/AS3.h"
    #include "problem.h"
    int main()
              problem *prob;
        prob = new problem;   
              printf("main\n");
        AS3_GoAsync();
    problem.h
    #ifndef _STATE_GAME_H_
    #define _STATE_GAME_H_
    #include "AS3/AS3++.h" // using AS3 var wrapper class
    #include "Flash++.h" // using AVM2 sync primitives
    // use "ui" AS3 var wrappers which marshall var manipulations to the ui Worker
    using namespace AS3::ui;
    class state_Game;
    class state_Menu;
    class problem {
              public:
                        problem();
                        void changeState(int k, state_Game *sg);
                        var update(state_Game *sg);
    #endif
    problem.cpp
    #include "problem.h"
    #ifndef _STATE_GAME_H_
    #define _STATE_GAME_H_
    #include "object_Background.h"
    void problem::changeState(int k, state_Game *sg)
              if (sg->getCurrrentState() >= 0)
                        sg->clearState();
                        sg->setCurrrentState(-1);
              state_Menu *psm;
              psm = new state_Menu;
    var problem::update(state_Game *sg)
              sg->update();
    problem::problem()
              state_Game *gameState;
              gameState = new state_Game;
              object_Background *background;
              background = new object_Background;
              changeState(0, gameState); //set to MENU_STATE at first
    #endif
    state_Menu.h
    #ifndef _STATE_GAME_H_
    #define _STATE_GAME_H_
    #include "state_Game.h"
    class state_Menu : public state_Game
              public:
                        state_Menu()
    #endif
    state_Game.h
    class state_Game {
              private:
                        int current_state;
              public:
                        state_Game()
                                            current_state = -1;
                        void makeState()
                        void clearState()
                        void update()
                        int getCurrrentState()
                                            return current_state;
                        void setCurrrentState(int k)
                                            current_state = k;
    When I compile this I get the following linker error:
    /var/folders/fs/ldvqpfrd2ng11w5d26f6qq540000gn/T//ccVLfrEH.o: error: undefined reference to '__ZN7problemC1Ev'
    This is a compiler generated file, '__ZN7problemC1Ev'.  I don't know why this is occurring since their are no errors in the compile phase and I do not have a class of this name.
    Can someone help me understand what is going on here?

    EDIT: Haha, so by the time I wrote this post, 3 people have already responded. Some of the stuff I cover has already been said.
    So I took a more in depth look at your code and I noticed a couple things. Granted, it's hard to debug code when I only have a small chunk but here's what I noticed:
    (Super small bug) You need to #include <stdio.h> in your main.cpp for the printf.
    There is a #ifndef _STATE_GAME_H_ in almost every file. During the pre-processing, it will pick up the fact that in subsequent files that you have this in, it will not include them. So, if you want to have each file included make a new pre-processor directive for each file.
    problem.h      => #ifndef _PROBLEM_H_
    state_Game.h => #ifndef _STATE_GAME_H_
    state_Menu.h => #ifndef _STATE_MENU_H_
    Also, as a side note for #2, don't put those #ifndefs in the .cpp files. They only need to be in the .h, but #include the .h in the .cpp.
    You don't seem to put parens after any of your constructors. You may want to explicitly specify to the compiler to use the nullary constructors.
              ex:
    === main.cpp ===
    #include <stdio.h>
    #include "problem.h"
    int main()
          problem *prob = new problem();                // <- this might be the problem
          printf("main\n");
          AS3_GoAsync();
    === problem.cpp ===
    #include "problem.h"
    #include "state_Menu.h"
    #include "state_Game.h"
    #include "object_Background.h"
    problem::problem()
              state_Game *gameState = new state_Game();
              object_Background *background = new object_Background();
              changeState(0, gameState); //set to MENU_STATE at first
    Finally, I've come to notice that putting .h files in the Makefile's build command does nothing. It will only respond to adding .cpp files. So for your state_Menu.h and state_Game.h files - as long as the pre-processing directives are setup correctly - they will be automagically included because there is no corresponding .cpp file. As long as problem.cpp and main.cpp are the only 2 .cpp files in your project, this commend will work.
    "$(FLASCC)/usr/bin/g++" $(BASE_CFLAGS) problem.cpp main.cpp -swf-size=960x540 -emit-swf -o problem.swf -lAS3++ -lFlash++

  • Linker error: undefined reference to `XMLParser::xmlinit(...)'

    Hi,
    I downloaded:
    "Oracle XML Developer's Kit for C++ for Solaris-9i"
    version: 9.2.0.2.0 03/31/02
    Now when I try to compile the demo files by doing make the linker gives me the following error:
    undefined reference to `XMLParser::xmlinit(...)'
    undefined reference to `XMLParser::xmlparse(...)'
    undefined reference to `XMLParser::getDocumentElement(void)'
    undefined reference to `XMLParser::xmlterm(void)'
    Any idea what could be wrong (I am using the same Makefile.defs which comes with this version)
    XDK_LIB=-lxmlg9 -lxml9 -lxsd9
    ORA_LIB=-lcore9 -lnls9 -lunls9 -lcore9 -lnls9 -lcore9
    NET_LIB=-lnsl -lsocket
    LIB= -L$(TOP)/lib $(XDK_LIB) $(ORA_LIB) $(NET_LIB)
    Thanks,
    Usman.

    This seems like a C++ problem. I don't think we can help you here.

  • Linker error----undefined reference to

    Hi
    i'm getting this error on linking ie on executing the command gcj --main=apps -o apps apps.o
    apps is the name of the file.....the code is compliling without error...
    Can anyone tell why this, 'undefined reference to......' error coming and how to correct it
    Here is the complete error msg...plz help
    [root@localhost ~]# gcj --main=apps -o apps apps.o
    apps.o: In function `javax::mail::PasswordAuthentication* SendMailUsingAuthentication$SMTPAuthenticator::getPasswordAuthentication()':
    apps.java:(.text+0x48cc): undefined reference to `javax::mail::PasswordAuthentication::class$'
    apps.java:(.text+0x48e9): undefined reference to `javax::mail::PasswordAuthentication::PasswordAuthentication(java::lang::String*, java::lang::String*)'
    apps.o: In function `SendMailUsingAuthentication$SMTPAuthenticator::SendMailUsingAuthentication$SMTPAuthenticator(SendMailUsingAuthentication*)':
    apps.java:(.text+0x490c): undefined reference to `javax::mail::Authenticator::Authenticator()'
    apps.o: In function `void SendMailUsingAuthentication::run()':
    apps.java:(.text+0x4ca5): undefined reference to `javax::mail::Session* javax::mail::Session::getDefaultInstance(java::util::Properties*, javax::mail::Authenticator*)'
    apps.java:(.text+0x4cd6): undefined reference to `void javax::mail::Session::setDebug(bool)'
    apps.java:(.text+0x4cdd): undefined reference to `javax::mail::internet::MimeMessage::class$'
    apps.java:(.text+0x4cfd): undefined reference to `javax::mail::internet::MimeMessage::MimeMessage(javax::mail::Session*)'
    apps.java:(.text+0x4d0d): undefined reference to `javax::mail::internet::InternetAddress::class$'
    apps.java:(.text+0x4d3c): undefined reference to `javax::mail::internet::InternetAddress::InternetAddress(java::lang::String*)'
    apps.java:(.text+0x4da1): undefined reference to `javax::mail::internet::InternetAddress::class$'
    apps.java:(.text+0x4de4): undefined reference to `javax::mail::internet::InternetAddress::class$'
    apps.java:(.text+0x4e13): undefined reference to `javax::mail::internet::InternetAddress::InternetAddress(java::lang::String*)'
    apps.java:(.text+0x4e82): undefined reference to `javax::mail::internet::InternetAddress::class$'
    apps.java:(.text+0x4ea5): undefined reference to `javax::mail::internet::InternetAddress::InternetAddress(java::lang::String*)'
    apps.java:(.text+0x4ee7): undefined reference to `javax::mail::Message$RecipientType::class$'
    apps.java:(.text+0x4ef1): undefined reference to `javax::mail::Message$RecipientType::TO'
    apps.java:(.text+0x4fb1): undefined reference to `void javax::mail::Transport::send(javax::mail::Message*)'
    apps.o:(.data+0x3168): undefined reference to `javax::mail::PasswordAuthentication* javax::mail::Authenticator::requestPasswordAuthentication(java::net::InetAddress*, int, java::lang::String*, java::lang::String*, java::lang::String*)'
    apps.o:(.data+0x316c): undefined reference to `java::net::InetAddress* javax::mail::Authenticator::getRequestingSite()'
    apps.o:(.data+0x3170): undefined reference to `int javax::mail::Authenticator::getRequestingPort()'
    apps.o:(.data+0x3174): undefined reference to `java::lang::String* javax::mail::Authenticator::getRequestingProtocol()'
    apps.o:(.data+0x3178): undefined reference to `java::lang::String* javax::mail::Authenticator::getRequestingPrompt()'
    apps.o:(.data+0x317c): undefined reference to `java::lang::String* javax::mail::Authenticator::getDefaultUserName()'
    apps.o:(.data+0x31f0): undefined reference to `javax::mail::Authenticator::class$'
    collect2: ld returned 1 exit status

    Double-post

  • OCCI Linking Error (undefined reference to `__intel_personality_routine')

    Machine: Itanium 2 (ia64)
    OS: Red Hat Enterprise Linux AS release 3 (Taroon Update 5)
    Oracle: Oracle 10g R2 (10.2.0.1.0) for Linux Itanium
    Compiler: gcc-3.2.3-52
    Problem:
    when I compile my application i get the following errors:
    /oracle/oracle/product/10.2.0/db_1/lib/libocci.so: undefined reference to `__intel_personality_routine'

    Hello Mr. Romeo,
    Unfortunately this week I don't have access to the build and development platform IA64 RHEL 4.5 so I can offer you just some approximate hints related to your last question (my current working platform is Solaris 10 x86-64 but there are similarities):
    0. Unpack your shipped ORACLE database package using:
    gunzip <oracle version>database<OS platform>_<OS architecture>.cpio.gz
    cpio -ivd < <oracle version>database<OS platform>_<OS architecture>.cpio
    1.In order to see what are the components including OCCI please run one of the belows:
    find database/ -name '*' -type f -exec grep -i 'libocci' {} \; 1>occi.lst 2>/dev/null
    or better
    for f in `find database/ -name '*.jar' -type f -print`; do unzip -l $f | grep occi; if [ $? -eq 0 ]; then printf "COMPONENT ------------------ %s\n" $f; fi; done
    basically you should get the following list of components:
    database/stage/Components/oracle.rdbms.rsf.ic/10.2.0.1.0/1/DataFiles/filegroup2.jar
    database/stage/Components/oracle.rdbms.oci/10.2.0.1.0/1/DataFiles/filegroup3.jar
    database/stage/Components/oracle.rdbms.oci/10.2.0.1.0/1/DataFiles/filegroup2.jar
    database/stage/Components/oracle.rdbms.oci/10.2.0.1.0/1/DataFiles/filegroup1.jar
    database/stage/Components/oracle.rsf.hybrid/10.2.0.0.0/1/DataFiles/filegroup3.jar
    As you can see there three distinct components including references to troublesome OCCI component.
    The first (oracle.rdbms.rsf.ic) one usually includes the shared library 'lib/libocci.so.10.1' which was built under the mixed RFC.IC environment: please check it by:
    -- create temporary directory AAA:
    mkdir -p AAA
    -- extract the component you need out of archive:
    unzip database/stage/Components/oracle.rdbms.rsf.ic/10.2.0.1.0/1/DataFiles/filegroup2.jar lib/libocci.so.10.1 -d AAA/
    -- check it by:
    file AAA/lib/libocci.so.10.1 (to get the binary file profile info)
    nm -Al AAA/lib/libocci.so.10.1 | grep __intel_personality_routine (searching out for undefined symbol...please refer man page of nm for further info)
    objdump -h AAA/lib/libocci.so.10.1 (to collect ELF-EFI profile info ...first two are important -h and -f ...)
    objdump -f AAA/lib/libocci.so.10.1
    objdump -x AAA/lib/libocci.so.10.1
    Here try to pick up some conclusions and eventually send me the outputs if don't manage figure out the outputs you get.
    The next three entries are coming from the component oracle.rdbms.oci (our bad guy...) and should contain something like:
    2733 09-13-05 13:23 bin/genoccish
    %ORACLE_HOME%/bin/genoccish
    COMPONENT ------------------ database/stage/Components/oracle.rdbms.oci/10.2.0.1.0/1/DataFiles/filegroup3.jar
    2425378 10-19-05 16:55 lib/libocci10.a
    %ORACLE_HOME%/lib/libocci10.a
    1259357 10-04-05 16:27 lib/libocci10_296.so.10.1
    %ORACLE_HOME%/lib/libocci10_296.so.10.1
    1752124 10-04-05 16:27 lib/libocci10_296.a
    %ORACLE_HOME%/lib/libocci10_296.a
    COMPONENT ------------------ database/stage/Components/oracle.rdbms.oci/10.2.0.1.0/1/DataFiles/filegroup2.jar
    2115 10-15-02 02:19 rdbms/public/occi.h
    %ORACLE_HOME%/rdbms/public/occi.h
    11600 03-03-04 03:59 rdbms/public/occiAQ.h
    %ORACLE_HOME%/rdbms/public/occiAQ.h
    38530 06-23-05 07:55 rdbms/public/occiCommon.h
    %ORACLE_HOME%/rdbms/public/occiCommon.h
    73063 01-10-05 20:08 rdbms/public/occiControl.h
    %ORACLE_HOME%/rdbms/public/occiControl.h
    35218 11-08-04 21:36 rdbms/public/occiData.h
    %ORACLE_HOME%/rdbms/public/occiData.h
    29156 11-13-03 20:59 rdbms/public/occiObjects.h
    %ORACLE_HOME%/rdbms/public/occiObjects.h
    COMPONENT ------------------ database/stage/Components/oracle.rdbms.oci/10.2.0.1.0/1/DataFiles/filegroup1.jar
    The last one just include related header files and have no relevance in our issue, so lets have a look over the first two:
    bin/genoccish – is the well known generation script (you already dealt with it)
    lib/libocci10.a – is the static library which isn't built from *.o files being already shipped :-(
    lib/libocci10_296.a – are for gcc296 and should be used only for GCC296...
    So our static library (archive) lib/libocci10.a should be also checked by:
    nm -Al AAA/lib/libocci10.a | grep __intel_personality_routine (searching out for undefined symbol...please refer man page of nm for further info)
    Most probable the symbol is there and is undefined...:-( So for the time being our work-around seems to be the only way we have !!!
    The last component is for hybrid platforms only (it could be missing from your IA64...I am not sure is IA64 is still treated as an hybrid platform...:-) ) and contains the 32 bit versions...you can check them as in the previous cases from above but assuming that these 32 bit versions are clean (not referring any uresoved symbols...:-)) this is restricting you to build your applications for 32 bit only...
    1764366 09-08-05 03:43 lib32//libocci10.a
    %ORACLE_HOME%/lib32//libocci10.a
    1397960 10-20-05 02:54 lib32//libocci.so.10.1
    %ORACLE_HOME%/lib32//libocci.so.10.1
    COMPONENT ------------------ database/stage/Components/oracle.rsf.hybrid/10.2.0.0.0/1/DataFiles/filegroup3.jar
    All the best and let me know if you need more support with that,
    Ioan

  • Linker error undefined reference

    I'm currently using codeblocks to compile my program... Can't seem to use the gpib functions even though I have already added the gpib-32.obj  as shown in the program.. any ideas??
    Attachments:
    [email protected] ‏101 KB

    This seems like a C++ problem. I don't think we can help you here.

  • Getting undefined reference error

    Hi Iam using GCC 4.1.2 in solaris with Oracle 9.0.2
    I have the following program
    #include <iostream.h>
    #include <occi.h>
    using namespace oracle::occi;
    using namespace std;
    int main()
    Environment *Env = Environment::createEnvironment(Environment::DEFAULT);
    When I do compile Iam getting the error
    undefined Reference Environment::createEnvironment(Environment::Mode,void,void.....
    etc error
    Please let me mkw what Iam missing

    After also Iam getting this error still in Solaris, g++ 4.1.2 with Oracle 9.2.0
    Undefined first referenced
    symbol in file
    __1cG__CrunKpure_error6F_v_ /usr/local/pkg/oracle/9.2.0/lib/libocci.so
    __1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJallocator4Cc___2G6Mpkc_r1_ /usr/local/pkg/oracle/9.2.0/lib/libocci.so
    __1cG__CrunIex_alloc6FI_pv_ /usr/local/pkg/oracle/9.2.0/lib/libocci.so
    __1cG__CrunIex_throw6Fpvpkn0AQstatic_type_info_pF1_v_v_ /usr/local/pkg/oracle/9.2.0/lib/libocci.so
    __1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJallocator4Cc___2G6Mrk1_r1_ /usr/local/pkg/oracle/9.2.0/lib/libocci.so
    __1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJallocator4Cc___2t6MpkcIrkn0C__v_ /usr/local/pkg/oracle/9.2.0/lib/libocci.so
    __1cH__rwstdRexcept_msg_string2t6MIE_v_ /usr/local/pkg/oracle/9.2.0/lib/libocci.so
    __1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJallocator4Cc___2t6Mpkcrkn0C__v_ /usr/local/pkg/oracle/9.2.0/lib/libocci.so
    __1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJallocator4Cc___Gassign6Mrk1II_r1_ /usr/local/pkg/oracle/9.2.0/lib/libocci.so
    _

  • Build cvm error: /UNIXProcess_md.c undefined reference to `__libc_wait'

    Hello,
    I used the follow command to build cvm in cdc:
    make CVM_DEBUG=true CVM_JAVABIN=$JAVA_HOME/bin
    CVM_GNU_TOOLS_PATH=/usr/bin
    The gcc's version is 2.95.3. J2SE version is J2SE 1.4. OS is Fedora 3. I got the following error message:
    Linking ../../build/linux-i686/bin/cvm
    ../../build/linux-i686/obj/UNIXProcess_md.o(.text+0x3ab): In function `sigchld_handler':
    /root/cdcfoundation/build/linux-i686/../../src/linux/native/java/lang/UNIXProcess_md.c:213: undefined reference to `__libc_wait'
    collect2: ld returned 1 exit status
    make: *** [../../build/linux-i686/bin/cvm] Error 1
    I think this problem relates to java and glibc library in redhat. Can someone give some propositions?
    Thanks a lot for help in advance!!
    zhiyong

    See here (original topic was double posted)
    http://forum.java.sun.com/thread.jspa?messageID=3528322&#3528322

  • When install db 10.2.0.1, report many undefined reference error.

    Hi,
    I try install the db 10.2.0.1 under fc4 linux.
    I select to install software only, but report error:
    Error invoking target 'relink' of makefile
    '/usr/local/oracle/db10g/precomp/lib/ins_precomp.mk' ...
    I check the install/make.log, there are many "undefined reference" error, as following:
    /usr/bin/make -f ins_precomp.mk relink ORACLE_HOME=/usr/local/oracle/db10g EXENAME=proc/Linking /usr/local/oracle/db10g/precomp/lib/proc
    /usr/local/oracle/db10g/lib//libclntsh.so: warning: warning: this program uses gets(), which is unsafe.
    /usr/local/oracle/db10g/precomp/lib/pdc.o(.text+0x236): In function `pdlitlen':
    : undefined reference to `__ctype_b_loc'
    /usr/local/oracle/db10g/precomp/lib/libpgp.a(pgstdf.o)(.text+0x39e): In function `pgswget':
    : undefined reference to `_IO_getc'
    Whether some lib be not found?
    Thanks!

    Keep reading the link log, those are warnings. there is an actual error somewhere.

  • Compiling errors libGL.so: undefined reference to `_nv001833gl

    i encountered these errors when compiling alienarena and projectM:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.3/../../../../lib/libGL.so: undefined reference to `_nv001833gl'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.3/../../../../lib/libGL.so: undefined reference to `_nv001835gl'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.3/../../../../lib/libGL.so: undefined reference to `_nv001834gl'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.3/../../../../lib/libGL.so: undefined reference to `_nv001836gl'
    im using arch64, nvidia drivers nvidia-180.29-3..
    can someone explain me what is going wrong here ?

    cant compile amarok2 from aur, same error. so i tried the beta driver 185.13, but after the kdm symbols faded in it doesnt switch to the desktop. im back to 180.29.
    this is very annoying, as i simply have not the knowledge to fix stuff like that

  • Link Error Linux AS3: undefined reference to `oracle::occi::Environment

    I got this error when i try to run sample database access using OCCI libraries.
    test.cpp:21: undefined reference to `oracle::occi::Environment::createEnvironment(oracle::occi::Environment::Mode, void*, void* (*)(void*, unsigned int), void* (*)(void*, void*, unsigned int), void (*)(void*, void*))'
    Following link contains same problem but there is no answer.
    #include <iostream>
    #include <occi.h>
    using oracle::occi::Connection;
    using oracle::occi::Environment;
    using oracle::occi::Statement;
    using oracle::occi::ResultSet;
    using namespace std;
    int main() {
    Environment *environment;
    Connection *con;
    Statement* stmt;
    ResultSet* res;
    try {
    //std::cout << "dasfasfafa";
    environment = Environment::createEnvironment(oracle::occi::Environment::DEFAULT);
    con = environment->createConnection("aaa", "aaa", "Caaa");
    stmt = con->createStatement("select * from emp");
    res = stmt->executeQuery();
    while (res->next())
    std::cout << res->getInt(1) << " " << res->getString(2) << std::endl;
    stmt->closeResultSet(res);
    con->terminateStatement(stmt);
    environment->terminateConnection(con);
    } catch (oracle::occi::SQLException &e) {
    std::cout << e.what();
    return 0;
    }

    The demos have this:
    #include <iostream>
    #include <occi.h>
    using namespace oracle::occi;
    using namespace std;
    ...

  • Error compiling OCCI example -  undefined reference

    Hello.
    I am having trouble linking a simple Oracle OCCI example using SunStudio 12 , Update 1 on RHEL 5.2 . This is the error.
    ~/demo]$ cat new.C
    #include<occi.h>
    using namespace oracle::occi;
    int main(){
    Environment *envr;
    envr=Environment::createEnvironment(Environment::DEFAULT);
    ~/demo]$ CC -L/apps/oracle/product/10.2.0/lib -I/apps/oracle/product/10.2.0/rdbms/public -locci -lclntsh new.C
    new.o: In function `main':
    new.C:(.text+0x64): undefined reference to `oracle::occi::Environment*oracle::occi::Environment::createEnvironment(oracle::occi::Environment::Mode,void*,void*(*)(void*,unsigned long),void*(*)(void*,void*,unsigned long),void(*)(void*,void*))'
    The same example compiles and links with a warning with g++ . executable is created.
    ~/demo]$ g++34 -L/apps/oracle/product/10.2.0/lib -I/apps/oracle/product/10.2.0/rdbms/public -locci -lclntsh new.C
    /usr/bin/ld: warning: libstdc++.so.5, needed by /apps/oracle/product/10.2.0/lib/libocci.so, may conflict with libstdc++.so.6
    Any ideas what may be wrong here ?
    Edited by: machambi on Jun 24, 2010 1:56 PM

    Well, without being able to recreate it myself, I think I'm stumped. I figured it was a linking error based on the error message but the format of the error message isn't familiar to me. What platform is this being done on?
    Other things I would do to try to track down the issue (I'm sure you've probably done most of these, but just to be thorough):
    Verify that the ${ORACLE_HOME}/lib/libocci.a library exists and you have read access to it. It will often be a symbolic link to a versioned library such as ${ORACLE_HOME}/lib/libocci10.a. In our Oracle installation we have a ${ORACLE_HOME}/lib and an ${ORACLE_HOME}/lib32, and in our case the libocci.a file is actually installed in the lib32 directory. However, I doubt the library is missing otherwise you would get a library not found error instead, but I'm not sure what error you would get if you didn't have read permissions.
    Try linking it directly instead of going through CC.
    Use a command like:
    ~/demo]$ nm -C ${ORACLE_HOME}/lib/libocci.a |grep "::createEnvironment(oracle" to make sure the function can be found within the occi library and in the format the linker is looking for.
    Look over the man pages on your linker looking for clarification on how it locates libraries, if it looks in additional locations or if there are any environment variables that would effect the paths you provided on the command line.
    -Christian

  • Linker error in c++ -- undefined reference to `vtable for String'

    While linking cpp file : wrapGetRndAmt.cpp which is below:
    wrapGetRndAmt.cpp .....
    #include <iostream.h>
    #include "archinfo.h"
    #include "syscodes.h"
    #include "currency_directory.h"
    extern MESSAGE_TYPE SetMemMarker();
    extern MESSAGE_TYPE FreeMemBlock();
    extern "C" int dm_login();
    extern "C" int dm_commit();
    extern "C" int dm_rollback();
    //extern MESSAGE_ARRAY *messageArray;
    struct tpsvcInfo *funcAry;
    /* Wrapper function to apply rounding rule (to the amount)*/
    int wrapGetRndAmt(char * ou_id, char * currency , double& amount)
    SetMemMarker();
    int rndng_rule=0;
    double rndng_val=0.0;
    double l_rtrnCode=0.0;
    double l_tmp=0.0;
    String * s_curr = new String(currency); ///This is the call of the String
    The error coming is:
    /home/gcrmdev/3.5/B/lib/h/xlstring.h:54: undefined reference to `vtable for String'
    /home/gcrmdev/3.5/B/lib/h/xlstring.h:54: undefined reference to `vtable for String'
    Header file is below:
    xlstring.h
    #ifdef SOLARIS
    11 #include "mystring.h"
    12 #else
    13 #include <string.h>
    14 #endif
    15 #include "xdr.h"
    16 #include <cppdefs.h>
    17 /* added by prabhat */
    18 #include "bglb.h"
    19 /* added by prabhat ends */
    20
    21 /*
    22 *-----------------------------------------------------------------------------
    23 * CLASS : String
    24 * PURPOSE : For performing all string operation
    25 * BASE CLASS : Object
    26 * PARENT CLASS : Object
    27 * COMMENT :
    28 * HISTORY :
    29 *-----------------------------------------------------------------------------
    30 */
    31 class String : public CppObj {
    32 int len;
    33 char *s;
    34
    35 public:
    36
    37 int operator == (const String &s1){ return strcmp(s,s1.s) ? 0 : 1;}
    38 int operator==(const Object &o)
    39 {
    40 return ( strcmp ( Type() , o.Type() ) == 0 )
    41 ? operator ==( ( const String &)o)
    42 : 0 ;
    43 }
    44 int operator != (const String &s1){ return strcmp(s,s1.s) ? 1 : 0;}
    45 int operator < (const String &s1){ return ( strcmp(s,s1.s) < 0 ) ? 1 : 0;}
    46 int operator <= (const String &s1){ return ( strcmp(s,s1.s) <= 0 ) ? 1 : 0;}
    47 int operator > (const String &s1){ return ( strcmp(s,s1.s) > 0 ) ? 1 : 0;}
    48 int operator >= (const String &s1){ return ( strcmp(s,s1.s) >= 0 ) ? 1 : 0;}
    49 operator String *() const { return new String( s ); }
    50 /* INT4 Length( INT4 & l ) const { l = len; return len; } */
    51 MESSAGE_TYPE Length( INT4 & l ) const { l = len; return XL_SUCCESS; }
    52 INT4 Length() const { return len; }
    53 /* DelhiPuneSync Changes : to take care of memAlloc fail */
    54 String( char const *s1) {
    55 if ( s1 == NULL) return;
    56 s = (char *)memAlloc((len = strlen(s1))+1);
    57 if (s != NULL)
    58 strcpy(s,s1);
    59 }
    Can someone help why this error is coming??
    Thanks is advance.
    Arabinda

    Hi,
    This is often the result of failing to include the orasqlX.lib file as input to the linker.
    I have a walkthrough of integrating Pro*C with Visual Studio here:
    http://oradim.blogspot.com/2009/05/oracle-proc-on-windows-with-express.html
    Maybe that will be of some help.
    How are you linking?
    Regards,
    Mark

  • Link error:libocci.so undefined reference to `cerr' on redhat with gcc 3.4.

    when I made a occi application , the compiler gave me following errors:
    g++ -locci -lclntsh -lclntst9 -locci9 -ldl -lc -lm -lstdc++ -lgcc_s occidemo.o -I/opt/oracle/product/9.2.0/rdbms/demo \
    -I/opt/oracle/product/9.2.0/rdbms/public \
    -L/opt/oracle/product/9.2.0/lib/ -L/usr/lib -o occidemo
    /opt/oracle/product/9.2.0/lib//libocci.so: undefined reference to `cerr'
    /opt/oracle/product/9.2.0/lib//libocci.so: undefined reference to `endl(ostream &)'
    /opt/oracle/product/9.2.0/lib//libocci.so: undefined reference to `__out_of_range(char const *)'
    /opt/oracle/product/9.2.0/lib//libocci.so: undefined reference to `__ctype_toupper'
    /opt/oracle/product/9.2.0/lib//libocci.so: undefined reference to `ostream::operator<<(char const *)'
    /opt/oracle/product/9.2.0/lib//libocci.so: undefined reference to `__length_error(char const *)'
    I guess that it could not find libstdc++.so ,so I run the command :
    # ldconfig -p | grep std
    libstdc++.so.6 (libc6) => /usr/lib/libstdc++.so.6
    libstdc++.so.5 (libc6) => /usr/lib/libstdc++.so.5
    libstdc++.so (libc6) => /usr/lib/libstdc++.so
    libstdc++-libc6.2-2.so.3 (libc6) => /usr/lib/libstdc++-libc6.2-2.so.3
    libstdc++-libc6.1-1.so.2 (libc6) => /usr/lib/libstdc++-libc6.1-1.so.2
    my environment is : Linux version 2.6.9-34.ELsmp , Red Hat Enterprise Linux AS release 4 (Nahant Update 3) (gcc version 3.4.5 20051201 (Red Hat 3.4.5-2)) #1 SMP Fri Feb 24 16:54:53 EST 2006
    I was so confused , please help me

    To use OCCI with g++ 3.4.5 (32-bit), you need to install Oracle Client 10.2.0.1.0 or 10.2.0.2.0 and download new OCCI libraries from :-
    http://otn.oracle.com/com/tech/oci/occi

  • Ora 12c install error on openSuse: undefined reference to symbol '__tls_get_addr@@GLIBC_2.3'

    Hi everyone,
    I know that Oracle does not support OpenSuSE, but all previous database versions worked.
    With Oracle 12c, the installation fails. I get the error below.
    Probably someone has a helpful idea?
    Yours, user8632123.
    INFO: make -f /home/oracle/base/rdbms/12.101/precomp/lib/ins_precomp.mk relink EXENAME=proc
    INFO: make[1]: Entering directory `/home/oracle/base/rdbms/12.101/precomp/lib'
    INFO: Linking /home/oracle/base/rdbms/12.101/precomp/lib/proc
    INFO: /usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: /home/oracle/base/rdbms/12.101/lib//libnls12.a(lxhlang.o): undefined reference to symbol '__tls_get_addr@@GLIBC_2.3'
    /usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: note: '__tls_get_addr@@GLIBC_2.3' is defined in DSO /lib64/ld-linux-x86-64.so.2 so try adding it to the linker command line
    /lib64/ld-linux-x86-64.so.2: could not read symbols: Invalid operation
    INFO: collect2: error: ld returned 1 exit status
    INFO: /bin/chmod: cannot access ‘/home/oracle/base/rdbms/12.101/precomp/lib/proc’
    INFO: : No such file or directory
    INFO: make[1]: Leaving directory `/home/oracle/base/rdbms/12.101/precomp/lib'
    INFO: make[1]: *** [/home/oracle/base/rdbms/12.101/precomp/lib/proc] Error 1
    INFO: make: *** [proc] Error 2

    I'm using opensuse 12.3 and I has this error too.
    My solution is
    1) backup {ORACLE_HOME}/lib/stubs and then delete it.
    2) change RMAN_LINKLINE in the file  {ORACLE_HOME}/rdbms/lib/env_rdbms.mk
         to
    RMAN_LINKLINE=$(LINK) $(OPT) $(S0MAIN) $(SSKRMED) $(SKRMPT) \
            $(LLIBDBTOOLS) $(LLIBCLIENT) $(LLIBSQL) $(LLIBPLSQL) \
            $(LLIBSNLSRTL) $(LLIBUNLSRTL) $(LLIBNLSRTL) \
            $(LLIBSLAX) $(LLIBPLSQL) $(LIBPLCN) $(LINKTTLIBS) -lons
    3) relink all.

Maybe you are looking for

  • Slow moving item question

    Hi, I have the following requirement. "Show all customers who have no sales in any given time period" I have implemented as per the following link http://help.sap.com/saphelp_nw04/helpdata/en/3a/d1603d13b5c72ee10000000a114084/frameset.htm I have used

  • Using Application GotomyPC

    My first day with a Mac and need some advice. I access my work PC which runs on Windows via an application called GotomyPC. After reading a 1000 threads I now accept I do not need to have antivirus software installed on my Mac though it seems pretty

  • FaceTime connection or lack of

    I have updated my iPad and now can't connect FaceTime, it rings but not connection. I have checked setting reinstalled, other iPad has latest update so could do with some advise thanks

  • PIVOT Function in isqlPlus ???  HELP please!

    I need to Pivot a column of Numeric data in a table. The data is as follows: (I generate this table in a VIEW): COL1 COL2 COL3 jdoe green -1 jdoe blue -1 jdoe yellow 0 jdoe red 0 jdoe orange -1 asmith blue 0 asmith green -1 asmith gold 0 asmith yello

  • Error: Unable to load style(SWF is not a loadable module)

    Hi,         While i am trying to load theme dynamically from server, i am getting an error like this      Error: Unable to load style(SWF is not a loadable module) Can anybody help me. regards, Jayagopal.