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.

Similar Messages

  • 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

  • Occi 11.1 Error on compile: undefined reference to `oracle::occi::Enviro...

    I'm trying to compile an hello world example on my computer. I've read the documentation for requirements occi on the site
    http://docs.oracle.com/cd/E11882_01/install.112/e24322/pre_install.htm#CHDHFGBJ
    It says that the g++ compiler 3.4.6 or later is supported. I have:
    Ubuntu 12.04
    gcc 4.6.3
    oracle instant client 11.2
    and the error is below, does anyone have a suggestion?
    g++ main.cpp -c -I/home/tim/skrivbord/bin/oracle/instantclient_11_2/include/ -D_REENTRANT -g -Wall
    g++ -o pippo -L/home/tim/skrivbord/bin/oracle/instantclient_11_2/ -locci -lclntsh -lociei -lnnz11 main.o
    main.o: In function `main':
    /home/tim/skrivbord/dev/cpp/main.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*))'
    collect2: ld returned 1 exit status
    make: *** [buildocci] Error 1
    main.cpp:
    #include <iostream>
    #include <occi.h>
    using namespace std;
    using namespace oracle::occi;
    int main(){
    Environment *environment;
    environment = Environment::createEnvironment();
    return 0;
    }

    For correctness I will close this question. I had made some errors with my environment variables LD_LIBRARY_PATH and specially I did not have libaio installed which is well documented that it has to be.

  • 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

  • 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;
    ...

  • 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

  • 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.

  • Installing Oracle 10g R2 on Debian Sarge - Undefined reference

    Hi all,
    I'm installing Oracle 10g R2 on debina sarge. I know this is possibile. But I'm only a problem during compilation:
    INFO: mv -f /opt/oracle/oracle/product/10.2.0/db_1/bin/dgmgrl /opt/oracle/oracle/product/10.2.0/db_1/bin/dgmgrlO
    INFO: mv /opt/oracle/oracle/product/10.2.0/db_1/rdbms/lib/dgmgrl /opt/oracle/oracle/product/10.2.0/db_1/bin/dgmgrl
    INFO: chmod 751 /opt/oracle/oracle/product/10.2.0/db_1/bin/dgmgrl
    INFO:
    INFO: - Linking tg4pwd utility
    INFO: rm -f /opt/oracle/oracle/product/10.2.0/db_1/rdbms/lib/tg4pwd
    INFO: gcc -o /opt/oracle/oracle/product/10.2.0/db_1/rdbms/lib/tg4pwd -L/opt/oracle/oracle/product/10.2.0/db_1/rdbms/lib/ -L/opt/oracle/oracle/product/10.2.0/db_1/lib/ -L/opt/oracle/oracle/product/10.2.0/db_1/lib/stubs/ -L/usr/lib -lirc /opt/oracle/oracle/product/10.2.0/db_1/rdbms/lib/tg4pwd.o /opt/oracle/oracle/product/10.2.0/db_1/rdbms/lib/defopt.o /opt/oracle/oracle/product/10.2.0/db_1/rdbms/lib/homts.o -lagtsh -lpls10 -lplp10 -lclntsh -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnl
    INFO: s10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 /opt/oracle/oracle/product/10.2.0/db_1/lib/libgeneric10.a `cat /opt/oracle/oracle/product/10.2.0/db_1/lib/sysliblist` -Wl,-rpath,/opt/oracle/oracle/product/10.2.0/db_1/lib -lm `cat /opt/oracle/oracle/product/10.2.0/db_1/lib/sysliblist` -ldl -lm -L/opt/oracle/oracle/product/10.2.0/db_1/lib -lvsn10
    INFO: /opt/oracle/oracle/product/10.2.0/db_1/lib//libagtsh.so: undefined reference to `nnfyboot'
    collect2: ld returned 1 exit status
    make: *** [opt/oracle/oracle/product/10.2.0/db_1/rdbms/lib/tg4pwd] Error 1
    I do not know if I miss a library. Who can help me?
    Thanks
    Stefano

    This happened to me also when installing on Slackware (current, now 10.2). Whenever you get errors in the OUI during the link phase, you should also take a look at $ORACLE_HOME/install/make.log. Turns out that the shared library libagtsh.so wasn't build which caused the errors during the link phase. Oracle expects 'basename' to be in /bin. Furthermore I noticed that Oracle expects 'libgcc_s.so.1' to be in /lib. On Slackware I did the following to successfully install 10g Release 2:
    cd /bin ; ln -sf /usr/bin/basename basename
    cd /lib ; ln -sf /usr/lib/libgcc_s.so.1 libgcc_s.so.1 ; ln -sf libgcc_s.so.1 libgcc_s.so
    Hope this helps,
    Joep

  • 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

  • JuseJSAssert Error calling selector function: Reference Error:'PIE' is undefined

    Since installing your new version of Adobe Muse yesterday I have not been able to get updated pages to upload to my website.  I have exported the html to my desktop and it looks right there but when I upload it to the website I get the following error message: MuseJSAssert: Error calling selector function: Reference Error:"PIE" is undefined.   I have uploaded only the updated page but then I tried uploading the whole site MANY times and it just is NOT working.  Can I go back to the prior version as I had no problems with it.  PLEASE help!  I have worked on this for two days and am tired of it and need to get my site working properly!  Thanks for your quick response!

    Whats the site URL in question? Are you uploading the site to Business Catalyst or to a third party hosting provider? Did you try uploading all site files through a FTP client like Filezilla? Is that a specific browser/version where the problem occurs?
    Thanks,
    Vinayak

  • 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
    _

  • Os x could not be installed on your computer undefined error

    After carefully following instructions to create a bootable USB drive with Yosemite and running disc utilities to erase the drive, I received the message "os x could not be installed on your computer undefined error 0." I see thousands of people have run into the same problem and jt appears Apple left out key details about what needed to be left on the root of the USB. This is unacceptable and, in fact, is fraud and misrepresentation under consumer protection laws.
    I've been using Macs since they were first introduced, but Apple has strayed so far from its roots, it's now a corporate rogue. Apple is going to envy Radio Shack's stock price when I get through with them. Executives and board members will now find their properties attached and face criminal--not just civil--penalties. Its jail time now for the criminals at Apple.

    Thank you for reading my comment. I ran disk utilities off the USB and erased the hard drive, aiming for a completely clean install. It appears the installer made per Apple's instructions omitted key install files.

  • 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.

Maybe you are looking for