Bool std::operator== char,std::char_traits........ undefined symbol error

Hi
I saw some issues related with this error in forum but this error is a little bit different from others I think. when I compile my code in OPTIMIZE (release) mode, there is nothing wrong. it can be compiled. but when i try to compile in debug mode (compiling with -g flag) compilation throws
Undefined first referenced
symbol in file
bool std::operator==<char,std::char_traits<char>,std::allocator<char> >(const std::basic_string<__type_0,__type_1,__type_2>&,const __type_0*) /dev/aykut/src/aaa.o
bool std::operator==<char,std::char_traits<char>,std::allocator<char> >(const __type_0*,const std::basic_string<__type_0,__type_1,__type_2>&) /dev/aykut/src/bbb.o
errors. I compiled with stlport4 library but in this time, some definitions cant be found like
Error: The function "strlen" must have a prototype.
Error: The function "strcasecmp" must have a prototype.
libCstd has ignored I think.
what is the reason of these errors ?
System info :
CC -V
CC: Sun C++ 5.8 Patch 121017-19 2009/03/12
uname -a
SunOS hitit 5.8 Generic_108528-03 sun4u sparc SUNW,Ultra-250

The missing symbols are due to an out-of-date /usr/lib/libCstd.so.1. Please get the current C++ runtime library patch for your version of Solaris and install it. You can get all patches here:
[http://developers.sun.com/sunstudio/downloads/patches/index.jsp]
The reason you see the problem only when compiling for debug is that compiling with -g disables function inlining, and the compiler needs to find more functions in the system library. An out-of-date library is often missing needed functions. If you compile with -g0 (g zero) instead, function inlining will occur as usual. Programs run faster when functions are inlined, and you have less dependence on the system libraries, but you can't debug a function if it has been inlined.
You don't see that particular problem with STLport because libstlport comes with the compiler, not as part of Solaris.
The reason you have problems with missing declarations when using STLport is because your code has failed to include standard headers that provide those declarations.
The C++ standard allows, but does not require, any of the C++ standard headers to include other standard headers. Implementations vary in what other headers, if any, a given standard header includes.
The rule is that if you use a standard library facility, you must explicitly include the associated header. For example, if you use strlen, you must explicitly include <string.h> or <cstring>. By accident, one of the C++ headers you include might include that header for you, but you can't depend on it.

Similar Messages

  • "undefined symbol" error while using a custom instrument driver

    Hello all, I'm facing a problem related to instrument driver creation.
    I want to pack a part of my code to a .FP to be able to reuse it in other applications of mine. This part of code includes calls to Windows API and a third party dll. I have included both windows.h and the include for the dll in the header file for the instrument. I developed the source code and next a little application that simply calls one function to test the result of my work, but I get some 'undefined symbol' errores while linking the test application with the instrument. The instrument header file is included in program source file.
    Situation is as follows:
    I can run the test application if I include the source file for the instrument directly in the project (without loading the instrument)
    I created a static library and can have the test program up and running if directly including the library in the project (again without the .fp file)
    I get linker errors when trying to use the instrument I created based on the same code, both when including the instrument at source code level and when including at library level. Adding the .fp to the project makes no difference
    Linker errors are all related to WinSDK and third-party dll functions.
    Question is: where and how I have to declare the symbols apart including the appropriate .h files in the instrument header file?
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

    Being waited on to log on... how flattering
    I wish I had a simple and obvious solution, but I don't.
    The problem in this case is that, whereas DLLs (via their import libraries) carry no additional build-time dependencies to their clients, that is not the case with object files and static libraries: any project that uses those .obj and .lib files must satisfy all of their dependencies when that project builds.
    There is a mechanism, with .fp files, to advertise such dependencies to the clients of the .fp, and that is the auto-load list (Edit>>FP Auto-Load List, in the function tree editor). The caveat, however, is that these indirect dependencies must have a companion .fp that you can add to this list. And in your case, you don't have one. So the only solution I can think of is for you to create a very thin wrapper module where you would wrap all of the SDK functions that you need, then create a basic .fp for this wrapper -- you can do this semi-automatically, from the header file (Options>>Generate Function Tree) -- and then add this .fp to the auto-load list of your primary .fp. And then you'll probably have to create a second .fp wrapper for your other dependency (a non-SDK third-party DLL?).
    Once you have declared the dependency chain for this .fp, you should then be able to use it on any test application and CVI should know to link in these additional static libraries whenever it builds the test application.
    If you choose to go this route, you'll probably have to deal with a bunch of non-standard data types in the parameters of the SDK functions. I don't remember if these are automatically added to the .fp when you create it from the header file. If not, all you need to do is add them to the .fp  later (Options>>Data Types, from the function panel editor). Don't worry about providing the definitions for these data types. They're not necessary. You just need to make sure that their names are in the list.
    Luis
    Message Edited by LuisG on 05-19-2010 10:43 AM

  • Missing prototype and Undefined Symbol errors

    So, I am using an Opal Keyy XEM3005 board.
    Depending on the documentation I read, this board has a native ANSI C interface with a C++ wrapper.
    In their forums, they say to rename the ".cpp" file to "c", and then go forward with calling the default constructor & keep track of the pointer.  Their functions are all in an externally loadable DLL.
    Well and good.
    Their API documentatin is available here:  http://www.opalkelly.com/library/FrontPanelAPI/
    I have written a REALLY simple app to ease my way in - it does nothing more than allow the user to throw a switch, and when this happens, it goes off to connect to the board:
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    #include <cvirte.h>
    #include <userint.h>
    #include "Try1.h"
    #include "XEM.h"
    #define _WIN32_WINNT 0x0501
    //#define _WIN32
    #include <windows.h>
    static int panelHandle;
    static okFrontPanel_HANDLE    XEM_Device;
    int __stdcall WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
    LPSTR lpszCmdLine, int nCmdShow)
    if (InitCVIRTE (hInstance, 0, 0) == 0)
    return -1;    /* out of memory */
    if ((panelHandle = LoadPanel (0, "Try1.uir", PANEL)) < 0)
            return -1;
        DisplayPanel (panelHandle);
        RunUserInterface ();
        DiscardPanel (panelHandle);
        return 0;
    int CVICALLBACK Connect (int panel, int control, int event,
            void *callbackData, int eventData1, int eventData2)
        int    Value = 0;
        switch (event)
            case EVENT_COMMIT:
                GetCtrlVal(PANEL, PANEL_CONNECT_SWITCH, &Value);
                SetCtrlVal(PANEL, PANEL_CONNECT_LED, Value);
                if( Value )
                    XEM_Connect(XEM_Device);
                else
                    XEM_Disconnect(XEM_Device);
                break;
        return 0;
    int CVICALLBACK Quit (int panel, int control, int event,
            void *callbackData, int eventData1, int eventData2)
        switch (event)
            case EVENT_COMMIT:
                QuitUserInterface (0);
                break;
        return 0;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    This, of course, works fine by itself (with empty _Connect() and _Disconnect() functions)
    I then started working with the XEM_Connect function.
    The first step is to run their LoadDLL function as such:
    int XEM_Connect ( okFrontPanel_HANDLE    XEM_Device )
        int    NoDevices = 0;    //    Number of devices attached to the PC
        //    Load the DLL (?)
        // Load the FrontPanel DLL
        if (FALSE == okFrontPanelDLL_LoadLib(NULL))
            printf("Could not load FrontPanel DLL\n");
            exit(-1);
        return XEM_SUCCESS;
    And this would compile and run just fine.
    Now, when I added the functions to start trying to get info about the device, I started getting "missing prototype" errors.
    int XEM_Connect ( okFrontPanel_HANDLE    XEM_Device )
        int    NoDevices = 0;    //    Number of devices attached to the PC
        //    Load the DLL (?)
        // Load the FrontPanel DLL
        if (FALSE == okFrontPanelDLL_LoadLib(NULL))
            printf("Could not load FrontPanel DLL\n");
            exit(-1);
        //    Find out how many devices are attached
        XEM_Device = okFrontPanel_Construct(  );
    //    XEM_Device = okCFrontPanel( void );
    //    NoDevices = GetDeviceCount( );
        printf("%d OK devices attached\n", NoDevices);
        //    Call the contructor?    
    //    okCFrontPanel ();
        return XEM_SUCCESS;
    Now, I searched the forums and found the bits about adding #define _WIN32_WINNT 0x0501 prior to inclusion of windows.h.  Did that.  No joy.
    Then I searched some more and found the bit about changing the build options to uncheck the "prototype required" flag.
    Done.
    This seemed to work at first (the above code could be built with no errors, and appeared to run).
    So I thought maybe I had it, and added the next line, so:
    int XEM_Connect ( okFrontPanel_HANDLE    XEM_Device )
        int    NoDevices = 0;    //    Number of devices attached to the PC
        //    Load the DLL (?)
        // Load the FrontPanel DLL
        if (FALSE == okFrontPanelDLL_LoadLib(NULL))
            printf("Could not load FrontPanel DLL\n");
            exit(-1);
        //    Find out how many devices are attached
        XEM_Device = okFrontPanel_Construct(  );
        OpenBySerial( XEM_Device, "UaLgzvVpBJ" );
    //    XEM_Device = okCFrontPanel( void );
    //    NoDevices = GetDeviceCount( );
        printf("%d OK devices attached\n", NoDevices);
        //    Call the contructor?    
    //    okCFrontPanel ();
        return XEM_SUCCESS;
    Now it doesn't complain about no prototypes (duh), but instead I get linker errors:
        Undefined symbol '_OpenBySerial@0' referenced in "XEM.c".
    So, dredging through the .h and .c files, I found a couple of things:
    in the okFrontPanel.c file I found the following:
    okDLLEXPORT ok_ErrorCode DLL_ENTRY
    okFrontPanel_OpenBySerial(okFrontPanel_HANDLE hnd, const char *serial)
        if (_okFrontPanel_OpenBySerial)
    ;  return((*_okFrontPanel_OpenBySerial)(hnd, serial));
        return(ok_UnsupportedFeature);
    In the okFrontPanel.h file I found:
    and also:
    okDLLEXPORT ok_ErrorCode DLL_ENTRY okFrontPanel_OpenBySerial(okFrontPanel_HANDLE hnd, const char *serial);
    So, I see them in the .h & .c files, but the linker is bombing out.
    I smell a problem with actual code to link being in the DLL...  How do I resolve this, any ideas?  Or am I doing something so stupidly (and obviously) wrong that I'm being blinded to it?

    Hi tomii,
    My suspicion is that these issues are due to using a C++ dll in a C environment. There are inherent challenges with performing such an operation as you have to make sure all your parameters and settings are correct.
    I also could not find the documentation that the Opal Kelly dll is ANSI C but it sounds like you can use this in C with some reconfiguration. I would recommend using their forums to get more information on what steps need to take place to get things working in ANSI C.
    From the information you provided, I did find some resources on the missing prototype error and undefined symbol issue with the linker.
    For the missing prototype I found a thread of someone actually using LabWindows and seeing this compiler error you may want to look at
    http://bytes.com/topic/c/answers/695019-missing-prototype
    I found a few cases where using a function definition of int func(void) removes such issue when int func() does not.
    Another link I found that may be worth a look can be found at http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html
    It gives some good pointers to mixing C and C++ code. Some of it may be applicible in your case.
    And, a resource for your undefined symbol linking issue.
    http://www.cprogramming.com/tutorial/compiler_linker_errors.html
    Hopefully these resources will give some context for getting things compiling and working with your dll.
    Good luck!
    James W.
    Applications Engineer
    National Instruments

  • Ild: (Performing full relink) internal free space in undefined symbol error

    I am using Sun Sparc C++ 5.4 compiler to compile some code.
    I had some issues with Makefile which I have resolved successfully for test program, which has only one string and print statetments.
    When I compile my program error_log.C program using Makefile, I am geting following errors.
    Same file for test program works ok.
    Any suggestions/pointers etc are much appreciated.
    Thanks
    Ravi
    ERRORS:
    ==================================================================================
    /opt/SUNWspro/bin/CC -g -compat=4 -V - YP,/ford/thishost/u/rbhave/mqrouter/lib:/usr/lib:/opt/SUNWspro/prod/lib -I/ford/thishost/u/rbhave/mqrouter/include -c error_log.c
    CC: Forte Developer 7 C++ 5.4 2002/03/09
    ccfe: Forte Developer 7 C++ 5.4 2002/03/09
    /opt/SUNWspro/bin/CC -g -compat=4 -V -YP,/ford/thishost/u/rbhave/mqrouter/lib:/usr/lib:/opt/SUNWspro/prod/lib -I/ford/thishost/u/rbhave/mqrouter/include error_log.o -o error_log -lXm -lXt -lX11 -lstring -lipc -lutils
    CC: Forte Developer 7 C++ 5.4 2002/03/09
    CClink: Forte Developer 7 C++ 5.4 2002/03/09
    CC: Forte Developer 7 C++ 5.4 2002/03/09
    ild: (Performing full relink) internal free space in output file exhausted (sections)
    /opt/SUNWspro/bin/../prod/bin/c++filt: Forte Developer 7 C++ 5.4 2002/03/09
    ild: Forte Developer 7 Incremental Linker 4.0 2002/03/09
    ild: Forte Developer 7 Incremental Linker 4.0 2002/03/09
    ild: (undefined symbol) ErrLog_c::ErrLog_c(void) -- referenced in the text segment of error_log.o
    ild: (undefined symbol) ErrLog_c::SetFileOutput(char*) -- referenced in the text segment of error_log.o
    ild: (undefined symbol) operator <<(ostream&, const String&) -- referenced in the text segment of /ford/thishost/u/rbhave/mqrouter/lib/libutils.a(ini_file.o)
    ild: (undefined symbol) operator <<(ostream&, const String&) -- referenced in the text segment of /ford/thishost/u/rbhave/mqrouter/lib/libutils.a(datetime.o)
    ild: (undefined symbol) IsSocketUsed(const char*, const char*) -- referenced in the text segment of /ford/thishost/u/rbhave/mqrouter/lib/libipc.a(socket_recv.o)
    ild: (undefined symbol) IsSocketUsed(const char*, const char*) -- referenced in the text segment of error_log.o
    ild: (undefined symbol) operator >>(istream&, String&) -- referenced in the text segment of /ford/thishost/u/rbhave/mqrouter/lib/libutils.a(general.o)
    ild: (undefined symbol) setsockopt -- referenced in the text segment of /ford/thishost/u/rbhave/mqrouter/lib/libipc.a(socket_recv.o)
    ild: (undefined symbol) recv -- referenced in the text segment of /ford/thishost/u/rbhave/mqrouter/lib/libipc.a(socket_recv.o)
    ild: (undefined symbol) bind -- referenced in the text segment of /ford/thishost/u/rbhave/mqrouter/lib/libipc.a(socket_recv.o)
    ild: (undefined symbol) socket -- referenced in the text segment of /ford/thishost/u/rbhave/mqrouter/lib/libipc.a(socket_dgram.o)
    ild: (undefined symbol) ErrLog_c::Rename(const ErrLogMesg_t&) -- referenced in the text segment of error_log.o
    ild: (undefined symbol) sendto -- referenced in the text segment of /ford/thishost/u/rbhave/mqrouter/lib/libipc.a(socket_dgram.o)
    ild: (undefined symbol) ErrLog_c::~ErrLog_c(void) -- referenced in the text segment of error_log.o
    *** Error code 5
    make: Fatal error: Command failed for target `error_log'
    ==================================================================================

    Try rebuilding with -xild=off to eliminate ild from the process.
    If it still doesn't link, delete the most recent .o files and try again to see how it goes.
    - Rose

  • Undefined symbol error when calling stat from extproc

    Hi, I'm trying to call an external procedure written in C that calls stat, and am getting the following error. Note that we have other extprocs running, and we are on Oracle 8.1.7 on redhat 6.2...
    SQL Error: ORA-06520: PL/SQL: Error loading external library
    ORA-06522: /tmp/extproc.so: undefined symbol: stat
    OS/compiler
    Linux enchilada 2.2.14-5.0 #1 Tue Mar 7 21:07:39 EST 2000 i686 unknown
    gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
    Oracle version: 8.1.7
    added following lines to file plsql/demo/extproc.c:
    (at top of file)
    #include <unistd.h>
    #include <sys/types.h>
    #include <sys/stat.h>
    #include <fcntl.h>
    (inside UpdateSalary function)
    struct stat mystat;
    stat("/tmp/foo", &mystat);
    reported error:
    SQL Error: ORA-06520: PL/SQL: Error loading external library
    ORA-06522: /tmp/extproc.so: undefined symbol: stat
    NOTE: when I remove call to stat, procudure runs properly.
    null

    I've talked to support, and this is supposedly a problem with Oracle not recognizing the library path. It is supposed to be fixed in 8.1.7.1.

  • Undefined symbol error when importing PyQt5.Core

    If I try to import (in python) PyQt5.QtCore, issues arise:
    ImportError Traceback (most recent call last)
    <ipython-input-1-2bb10a0eb39a> in <module>()
    ----> 1 import PyQt5.QtCore
    ImportError: /usr/lib/python3.4/site-packages/PyQt5/QtCore.so: undefined symbol: _ZTI13QFileSelector
    Unwrapping that symbol with c++filt, I get:
    typeinfo for QFileSelector
    This issue pops up when compiling sonic-pi-git. It also prevents the launch of applications like leo that import PyQt5.Core.
    This is only an issue on one of my systems, a laptop with an Intel i7 (Haswell) processor. My AMD-based desktop does not have this issue.
    I think it's probably a poorly installed library, but which one it is and how I fix it is a mystery to me. Any thoughts are appreciated, more info can be provided on request. Thank you for your time.

    Well I've got good news and bad news it seems.
    Bad: installing the latest development snapshot of PyQt5 (PyQt-gpl-5.5-snapshot-f6bfd44ba749) from their website did not solve the problem. The same error occurs on trying to import PyQt5.QtCore. This issue is still non-existant on my Antergos VM with the official packages, which have the same version numbers as those in the Arch repos. 
    Good: removing the python2-pyqt5 package solves my issue with launching the program Leo, so it seems the library import and Leo issues might be unrelated. Still need this package as a dependency for other programs though...
    I'm kind of stumped. Is the next best step just removing packages until I've found the one that's breaking this part of the library, or seeking some help upstream? And is anyone else running into this issue as well, or is it really just me?

  • Linking Error : Undefined Symbols: SUN Studio 5

    Hi ,
    I am facing some Linking error which throws up Undefined Symbol errors like .
    [Undefined                       first referenced
    symbol                             in file
    __rwstd::__rb_tree<DevNexus,DevNexus,__rwstd::__ident<DevNexus,DevNexus>,std::less<DevNexus>,std::allocator<DevNexus> >::iterator __rwstd::__rb_tree<DevNexus,DevNexus,__rwstd::__ident<DevNexus,DevNexus>,std::less<DevNexus>,std::allocator<DevNexus> >::erase(__rwstd::__rb_tree<DevNexus,DevNexus,__rwstd::__ident<DevNexus,DevNexus>,std::less<DevNexus>,std::allocator<DevNexus> >::iterator,__rwstd::__rb_tree<DevNexus,DevNexus,__rwstd::__ident<DevNexus,DevNexus>,std::less<DevNexus>,std::allocator<DevNexus> >::iterator) PacketServer.o
    __type_0 std::find<std::deque<AdapterPort,std::allocator<AdapterPort> >::iterator,AdapterPort>(__type_0,__type_0,const __type_1&) PacketServer.o
    void std::vector<Controller,std::allocator<Controller> >::__insert_aux(Controller*,const Controller&) Subsystem.o
    void std::deque<AdapterDisc,std::allocator<AdapterDisc> >::__allocate_at_end() PacketServer.o
    __rwstd::__rb_tree<unsigned long,std::pair<const unsigned long,char*>,__rwstd::__select1st<std::pair<const unsigned long,char*>,unsigned long>,std::less<unsigned long>,std::allocator<std::pair<const unsigned long,char*> > >::iterator __rwstd::__rb_tree<unsigned long,std::pair<const unsigned long,char*>,__rwstd::__select1st<std::pair<const unsigned long,char*>,unsigned long>,std::less<unsigned long>,std::allocator<std::pair<const unsigned long,char*> > >::erase(__rwstd::__rb_tree<unsigned long,std::pair<const unsigned long,char*>,__rwstd::__select1st<std::pair<const unsigned long,char*>,unsigned long>,std::less<unsigned long>,std::allocator<std::pair<const unsigned long,char*> > >::iterator,__rwstd::__rb_tree<unsigned long,std::pair<const unsigned long,char*>,__rwstd::__select1st<std::pair<const unsigned long,char*>,unsigned long>,std::less<unsigned long>,std::allocator<std::pair<const unsigned long,char*> > >::iterator) DeviceProp.o
    std::deque<AdapterPort,std::allocator<AdapterPort> >::~deque() PacketServer.o
    __type_0 std::find<std::deque<AdapterDisc,std::allocator<AdapterDisc> >::iterator,char*>(__type_0,__type_0,const __type_1&) PacketServer.o
    unsigned std::deque<AdapterPort,std::allocator<AdapterPort> >::__buffer_size() PacketServer.o
    unsigned std::deque<AdapterDisc,std::allocator<AdapterDisc> >::__buffer_size() PacketServer.o
    void __rwstd::__rb_tree<DevNexus,DevNexus,__rwstd::__ident<DevNexus,DevNexus>,std::less<DevNexus>,std::allocator<DevNexus> >::__deallocate_buffers() PacketServer.o
    std::deque<AdapterDisc,std::allocator<AdapterDisc> >::~deque() PacketServer.o
    ld: fatal: Symbol referencing errors. No output written to spagent
    *** Error code 1
    make: Fatal error: Command failed for target `spagent'
    Current working directory /home/kiranc/solaris_hang1/4.0/agent
    *** Error code 1
    make: Fatal error: Command failed for target `recurse'
    Current working directory /home/kiranc/solaris_hang1/4.0/agent
    *** Error code 1
    make: Fatal error: Command failed for target `all'
    I am using Sun Studio 5. Pls let me know how to resolve/fix this. Unfortunately I cant upgrade the Sun Studio.
    Thanks in Advance
    Kiran                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Hi Kiran ,
    if you cannot upgrade Sun Studio, I suggest that you take a view on this solution:
    http://forum.java.sun.com/thread.jspa?forumID=850&threadID=5069680
    It only works to std::vector::__insert_aux method, but I think you could get some useful idea from it.
    Good luck.
    Bye.

  • Linking Error : Undefined Symbols

    Hi evryone,
    I am facing some Linking error which throws up Undefined Symbol errors like .
    Undefined first referenced
    symbol in file
    vector<DPEEDFU>::insert_aux(DPEEDFU*, const DPEEDFU&) ./obj/dpeesel.o
    I am migrating the code to Sun 5.2 & using -compat=4 for compilation.
    On some analysis using nm , I found that the symbols which are flagged as UNDEFINED are in fact getting defined in the temporary objects created in the SunWS_cache directory.
    Any suggestion on how to resolve this.
    urgent help needed.
    Thanks & Regards
    shiva

    Hi,
    I am running into same(similar) issue. I am using Forte 6 update2. I have created the links manually. I am looking to do dynamic linking of the libCstd. Now,
    here's a snippet of the error I see :
    /import/sunray/tools/WS6u2/SUNWspro/bin/CC -o SunOS.sparc/uttsc SunOS.sparc/main.o SunOS.sparc/platforminfo.o -L../../lib/tscutil/SunOS.sparc -L../../lib/addins/rdpdr/fs/SunOS.sparc -L../../lib/addins/rdpdr/scard/SunOS.sparc -L../../lib/addins/rdpdr/print/SunOS.sparc -L../../lib/addins/rdpdr/serial/SunOS.sparc -L../../lib/addins/rdpdr/SunOS.sparc -L../../lib/enum/SunOS.sparc -L../../lib/addins/cliprdr/SunOS.sparc -L../../lib/audio/SunOS.sparc -L../../lib/aipa/SunOS.sparc -L../../lib/addins/rdpsnd/SunOS.sparc -L../../lib/util/SunOS.sparc -L../../lib/vxrdp/SunOS.sparc -L../../lib/vx/SunOS.sparc -L../../lib/rdp/SunOS.sparc -L../../lib/mcs/SunOS.sparc -L../../lib/isot/SunOS.sparc -L../../lib/common/SunOS.sparc -L../../lib/X11/SunOS.sparc -L../../lib/platform/SunOS.sparc -L../../lib/device/serial/posix/SunOS.sparc -L../../lib/device/fs/posix/SunOS.sparc
    -L../../lib/device/print/lpr/SunOS.sparc -L../../lib/device/SunOS.sparc -L/usr/X11R6/lib -L/usr/openwin/lib -ltscutil --lcommon  -lXext -lX11 -lplatform -lCstd -lcrypto
    Undefined first referenced
    symbol in file
    void std::list<addins::rdpdr::IDeviceService*,std::allocator<addins::rdpdr::IDeviceService*> >::__deallocate_buffers() ../../lib/addins/rdpdr/SunOS.sparc/librdpdr.a(devicemanager.o)
    bind ../../lib/platform/SunOS.sparc/libplatform.a(socket.o) (symbol belongs to implicit dependency /usr/lib/libsocket.so.1)
    std::pair<__rwstd::__rb_tree<unsigned,std::pair<const unsigned,device::serial::Device*>,__rwstd::__select1st<std::pair<const unsigned,device::serial::Device*>,unsigned>,std::less<unsigned>,std::allocator<std::pair<const unsigned,device::serial::Device*> > >::iterator,bool>__rwstd::__rb_tree<unsigned,std::pair<const unsigned,device::serial::Device*>,__rwstd::__select1st<std::pair<const unsigned,device::serial::Device*>,unsigned>,std::less<unsigned>,std::allocator<std::pair<const unsigned,device::serial::Device*> > >::insert(const std::pair<const unsigned,device::serial::Device*>&) ../../lib/addins/rdpdr/serial/SunOS.sparc/librdpdrserial.a(source.o)
    void __rwstd::__rb_tree<unsigned,std::pair<const unsigned,device::fs::Device*>,__rwstd::__select1st<std::pair<const unsigned,device::fs::Device*>,unsigned>,std::less<unsigned>,std::allocator<std::pair<const unsigned,device::fs::Device*> > >::__deallocate_buffers() ../../lib/addins/rdpdr/fs/SunOS.sparc/librdpdrfs.a(rdpdrfssource.o)
    __type_1 std::copy<std::deque<Buffer,std::allocator<Buffer> >::const_iterator,std::back_insert_iterator<std::deque<Buffer,std::allocator<Buffer> > > >(__type_0,__type_0,__type_1) ../../lib/audio/SunOS.sparc/libaudio.a(audiodevsink.o)
    std::list<enumeration::DeviceInfo*,std::allocator<enumeration::DeviceInfo*> >::iterator std::list<enumeration::DeviceInfo*,std::allocator<enumeration::DeviceInfo*> >::erase(std::list<enumeration::DeviceInfo*,std::allocator<enumeration::DeviceInfo*> >::iterator,std::list<enumeration::DeviceInfo*,std::allocator<enumeration::DeviceInfo*> >::iterator) ../../lib/enum/SunOS.sparc/libenum.a(pnpmodule.o)
    ...<many more>...
    How did you resolve your issue ?
    Thanks
    Sangeeta

  • Libboost_python.so has tons of undefined symbols

    I've been trying to get Luxrender to work with Blender 2.63. The pylux.so module never loaded for some reason, so I traced the problem back to the libboost_python.so file and it seems to be throwing a ton of undefined symbol errors, all of them mentioning Python:
    blender ~ $ ldd -r /usr/lib/libboost_python.so
    linux-vdso.so.1 => (0x00007fffa14a8000)
    libutil.so.1 => /lib/libutil.so.1 (0x00007fd6c993c000)
    libpthread.so.0 => /lib/libpthread.so.0 (0x00007fd6c9720000)
    libdl.so.2 => /lib/libdl.so.2 (0x00007fd6c951b000)
    librt.so.1 => /lib/librt.so.1 (0x00007fd6c9313000)
    libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007fd6c900f000)
    libm.so.6 => /lib/libm.so.6 (0x00007fd6c8d19000)
    libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007fd6c8b04000)
    libc.so.6 => /lib/libc.so.6 (0x00007fd6c8763000)
    /lib/ld-linux-x86-64.so.2 (0x00007fd6c9dc3000)
    undefined symbol: PyExc_ImportError (/usr/lib/libboost_python.so)
    undefined symbol: PyProperty_Type (/usr/lib/libboost_python.so)
    undefined symbol: PyExc_StopIteration (/usr/lib/libboost_python.so)
    undefined symbol: PyBool_Type (/usr/lib/libboost_python.so)
    undefined symbol: PyClass_Type (/usr/lib/libboost_python.so)
    undefined symbol: PyExc_ValueError (/usr/lib/libboost_python.so)
    undefined symbol: PyList_Type (/usr/lib/libboost_python.so)
    undefined symbol: _Py_NotImplementedStruct (/usr/lib/libboost_python.so)
    undefined symbol: PyExc_TypeError (/usr/lib/libboost_python.so)
    undefined symbol: PyDict_Type (/usr/lib/libboost_python.so)
    undefined symbol: PyInt_Type (/usr/lib/libboost_python.so)
    undefined symbol: PyComplex_Type (/usr/lib/libboost_python.so)
    undefined symbol: PyExc_ReferenceError (/usr/lib/libboost_python.so)
    undefined symbol: PyModule_Type (/usr/lib/libboost_python.so)
    undefined symbol: PyBaseObject_Type (/usr/lib/libboost_python.so)
    undefined symbol: PyFloat_Type (/usr/lib/libboost_python.so)
    undefined symbol: PyExc_IndexError (/usr/lib/libboost_python.so)
    undefined symbol: PyUnicode_Type (/usr/lib/libboost_python.so)
    undefined symbol: PyTuple_Type (/usr/lib/libboost_python.so)
    undefined symbol: PyExc_RuntimeError (/usr/lib/libboost_python.so)
    undefined symbol: PyType_Type (/usr/lib/libboost_python.so)
    undefined symbol: PyMethod_Type (/usr/lib/libboost_python.so)
    undefined symbol: PyStaticMethod_Type (/usr/lib/libboost_python.so)
    undefined symbol: PyLong_Type (/usr/lib/libboost_python.so)
    undefined symbol: _Py_NoneStruct (/usr/lib/libboost_python.so)
    undefined symbol: PyExc_OverflowError (/usr/lib/libboost_python.so)
    undefined symbol: PyExc_AttributeError (/usr/lib/libboost_python.so)
    undefined symbol: PyCFunction_Type (/usr/lib/libboost_python.so)
    undefined symbol: PyString_Type (/usr/lib/libboost_python.so)
    undefined symbol: PyType_GenericAlloc (/usr/lib/libboost_python.so)
    undefined symbol: PyList_Insert (/usr/lib/libboost_python.so)
    undefined symbol: PyString_InternFromString (/usr/lib/libboost_python.so)
    undefined symbol: PyString_AsString (/usr/lib/libboost_python.so)
    undefined symbol: PyUnicodeUCS4_FromEncodedObject (/usr/lib/libboost_python.so)
    undefined symbol: PyImport_Import (/usr/lib/libboost_python.so)
    undefined symbol: PyNumber_InPlaceRshift (/usr/lib/libboost_python.so)
    undefined symbol: PyObject_CallMethod (/usr/lib/libboost_python.so)
    undefined symbol: PyIter_Next (/usr/lib/libboost_python.so)
    undefined symbol: PyNumber_Remainder (/usr/lib/libboost_python.so)
    undefined symbol: Py_InitModule4_64 (/usr/lib/libboost_python.so)
    undefined symbol: PyType_Ready (/usr/lib/libboost_python.so)
    undefined symbol: _PyEval_SliceIndex (/usr/lib/libboost_python.so)
    undefined symbol: PyFile_AsFile (/usr/lib/libboost_python.so)
    undefined symbol: PyLong_FromUnsignedLong (/usr/lib/libboost_python.so)
    undefined symbol: PyMem_Free (/usr/lib/libboost_python.so)
    undefined symbol: PyNumber_InPlaceXor (/usr/lib/libboost_python.so)
    undefined symbol: PyNumber_InPlaceOr (/usr/lib/libboost_python.so)
    undefined symbol: PyBool_FromLong (/usr/lib/libboost_python.so)
    undefined symbol: PyDict_Items (/usr/lib/libboost_python.so)
    undefined symbol: PyNumber_InPlaceRemainder (/usr/lib/libboost_python.so)
    undefined symbol: PyErr_NoMemory (/usr/lib/libboost_python.so)
    undefined symbol: PyComplex_ImagAsDouble (/usr/lib/libboost_python.so)
    undefined symbol: PyObject_IsTrue (/usr/lib/libboost_python.so)
    undefined symbol: PyNumber_Lshift (/usr/lib/libboost_python.so)
    undefined symbol: PyNumber_InPlaceMultiply (/usr/lib/libboost_python.so)
    undefined symbol: _PyObject_New (/usr/lib/libboost_python.so)
    undefined symbol: PyObject_GetItem (/usr/lib/libboost_python.so)
    undefined symbol: PyString_FromStringAndSize (/usr/lib/libboost_python.so)
    undefined symbol: PyNumber_InPlaceLshift (/usr/lib/libboost_python.so)
    undefined symbol: PyString_Size (/usr/lib/libboost_python.so)
    undefined symbol: PyDict_Update (/usr/lib/libboost_python.so)
    undefined symbol: PyComplex_RealAsDouble (/usr/lib/libboost_python.so)
    undefined symbol: PyErr_Format (/usr/lib/libboost_python.so)
    undefined symbol: PyNumber_And (/usr/lib/libboost_python.so)
    undefined symbol: PyUnicodeUCS4_AsWideChar (/usr/lib/libboost_python.so)
    undefined symbol: PyNumber_InPlaceAdd (/usr/lib/libboost_python.so)
    undefined symbol: PyObject_GetAttr (/usr/lib/libboost_python.so)
    undefined symbol: PyErr_ExceptionMatches (/usr/lib/libboost_python.so)
    undefined symbol: PyErr_Occurred (/usr/lib/libboost_python.so)
    undefined symbol: PyDict_Copy (/usr/lib/libboost_python.so)
    undefined symbol: PyArg_ParseTupleAndKeywords (/usr/lib/libboost_python.so)
    undefined symbol: PyNumber_Divide (/usr/lib/libboost_python.so)
    undefined symbol: PyEval_GetGlobals (/usr/lib/libboost_python.so)
    undefined symbol: PyDict_Keys (/usr/lib/libboost_python.so)
    undefined symbol: PyErr_SetObject (/usr/lib/libboost_python.so)
    undefined symbol: PyNumber_Multiply (/usr/lib/libboost_python.so)
    undefined symbol: PyRun_FileExFlags (/usr/lib/libboost_python.so)
    undefined symbol: PyObject_Size (/usr/lib/libboost_python.so)
    undefined symbol: PyString_FromString (/usr/lib/libboost_python.so)
    undefined symbol: PyString_FromFormat (/usr/lib/libboost_python.so)
    undefined symbol: PyNumber_InPlaceAnd (/usr/lib/libboost_python.so)
    undefined symbol: PyInt_FromLong (/usr/lib/libboost_python.so)
    undefined symbol: PyDict_Size (/usr/lib/libboost_python.so)
    undefined symbol: PyDict_GetItem (/usr/lib/libboost_python.so)
    undefined symbol: PyObject_SetItem (/usr/lib/libboost_python.so)
    undefined symbol: PyInt_AsLong (/usr/lib/libboost_python.so)
    undefined symbol: PyObject_RichCompare (/usr/lib/libboost_python.so)
    undefined symbol: PyCFunction_NewEx (/usr/lib/libboost_python.so)
    undefined symbol: PyDict_Values (/usr/lib/libboost_python.so)
    undefined symbol: PyNumber_Rshift (/usr/lib/libboost_python.so)
    undefined symbol: PyStaticMethod_New (/usr/lib/libboost_python.so)
    undefined symbol: PyType_IsSubtype (/usr/lib/libboost_python.so)
    undefined symbol: PyNumber_Add (/usr/lib/libboost_python.so)
    undefined symbol: PyList_Sort (/usr/lib/libboost_python.so)
    undefined symbol: PySequence_DelSlice (/usr/lib/libboost_python.so)
    undefined symbol: PyErr_WarnEx (/usr/lib/libboost_python.so)
    undefined symbol: PyNumber_Xor (/usr/lib/libboost_python.so)
    undefined symbol: PyObject_ClearWeakRefs (/usr/lib/libboost_python.so)
    undefined symbol: PyNumber_Subtract (/usr/lib/libboost_python.so)
    undefined symbol: PySlice_New (/usr/lib/libboost_python.so)
    undefined symbol: PyObject_GetAttrString (/usr/lib/libboost_python.so)
    undefined symbol: PyObject_IsInstance (/usr/lib/libboost_python.so)
    undefined symbol: PyRun_StringFlags (/usr/lib/libboost_python.so)
    undefined symbol: PyObject_SetAttrString (/usr/lib/libboost_python.so)
    undefined symbol: PyWeakref_NewRef (/usr/lib/libboost_python.so)
    undefined symbol: PyErr_NewException (/usr/lib/libboost_python.so)
    undefined symbol: PyList_Append (/usr/lib/libboost_python.so)
    undefined symbol: PyObject_SetAttr (/usr/lib/libboost_python.so)
    undefined symbol: PyDict_GetItemString (/usr/lib/libboost_python.so)
    undefined symbol: PyNumber_InPlaceDivide (/usr/lib/libboost_python.so)
    undefined symbol: PyLong_AsLongLong (/usr/lib/libboost_python.so)
    undefined symbol: PyLong_AsUnsignedLongLong (/usr/lib/libboost_python.so)
    undefined symbol: PyNumber_Or (/usr/lib/libboost_python.so)
    undefined symbol: PyObject_DelItem (/usr/lib/libboost_python.so)
    undefined symbol: PyNumber_InPlaceSubtract (/usr/lib/libboost_python.so)
    undefined symbol: PyMethod_New (/usr/lib/libboost_python.so)
    undefined symbol: PyEval_CallFunction (/usr/lib/libboost_python.so)
    undefined symbol: PySequence_GetSlice (/usr/lib/libboost_python.so)
    undefined symbol: PyTuple_Size (/usr/lib/libboost_python.so)
    undefined symbol: PyImport_ImportModule (/usr/lib/libboost_python.so)
    undefined symbol: PyErr_Clear (/usr/lib/libboost_python.so)
    undefined symbol: PyTuple_New (/usr/lib/libboost_python.so)
    undefined symbol: PyTuple_GetItem (/usr/lib/libboost_python.so)
    undefined symbol: PyErr_SetString (/usr/lib/libboost_python.so)
    undefined symbol: PyObject_CallFunction (/usr/lib/libboost_python.so)
    undefined symbol: PyList_Reverse (/usr/lib/libboost_python.so)
    undefined symbol: PyFile_FromString (/usr/lib/libboost_python.so)
    undefined symbol: _PyType_Lookup (/usr/lib/libboost_python.so)
    undefined symbol: PyList_New (/usr/lib/libboost_python.so)
    undefined symbol: PyMem_Malloc (/usr/lib/libboost_python.so)
    undefined symbol: PyCallable_Check (/usr/lib/libboost_python.so)
    undefined symbol: PyDict_Clear (/usr/lib/libboost_python.so)
    undefined symbol: PySequence_SetSlice (/usr/lib/libboost_python.so)
    undefined symbol: PyLong_AsUnsignedLong (/usr/lib/libboost_python.so)
    undefined symbol: PyDict_New (/usr/lib/libboost_python.so)
    I'm not entirely sure what the problem is. There was a bug report filed for the exact same problem a few years ago and it was taken upstream to the boost developers (and later fixed), but I can't understand how the problem was actually solved except for a single patch.
    Does anyone know what these errors mean and what I can do to fix things?

    @sand_man about vegastrike-svn, i remember i've look at it at some point and a discussion was in arch-general about it. that application has multiple versions of boost.
    http://permalink.gmane.org/gmane.linux. … eral/32489
    also i think that  vegastrike-svn building system needs to add a proper flag for linking, like passing -lpython2.7 or -lpython3, depending of what is using
    Last edited by wonder (2011-03-04 10:00:14)

  • SunStudio 11 cannot link libtiff in Solaris 10 (undefined symbol)

    Hello
    we are producing a software using multiple external libraries, among them Sam Leffler's TIFF library version 3.6.1
    This software compiles and runs well on Solaris 9 / SunStudio 11
    But in Solaris 10 / SunStudio we get an 'undefined symbol' error even if the symbol exists!!
    I have patched the OS and SunStudio to the latest level required but it's no help
    the linker error message is:
    CC -compat=4 -I../AGR -I../STA -I../SVI -I../KRN -I../COMMON_APAS -I../CXML -I../SCS -I. -I../INCLUDE -I../AFC -I../ITI -I../IEM -I../MMF -I../MMI -I../ICS -I../EIV -I../TSF -I../TTM -I../TIM -I../MIR -I../INA -I../INX -I../DEC -I../MAR -I../IXA -I../MXR -I../ICO -I../JPEG -I../LTIFF -I../OVS -I../UTIL -I../TRE -I../IRE -I../INR -I../IST -I../IXR -I/opt/SUNWspro/prod/include/CC -I/usr/include -g0 -libmil -xtarget=native -mt -xildoff -keeptmp -verbose=%all -L/usr/lib -L/usr/local/lib -LFPCSolaris10 -L../lib/FPCSolaris10 -L/opt/SUNWspro/prod/lib/rw7/CC4 -L/opt/SUNWspro/lib -L/usr/X11R6/lib -o FPCSolaris10/MainItls_ils FPCSolaris10/MainItls_ils.o FPCSolaris10/MAIN_Module_ils.o -lICS -lEIV -lMIR -lINA -lDEC -lMAR -lICO -lMXR -lIXA -lOVS -lUtil -ltiff -lSVIils -lSTAils -lKRN -lSCS -lITIils -lIEMils -lAGR -lMMF -lAFC -lMMI -lCXML -lcommon_apas -Bstatic -lrwtool -Bdynamic -lnsl -lposix4 -lsocket -lxnet -ldl -lgen -lcurses -lXm -lXt -lX11 -lxml2
    ld: Software Generation Utilities - Solaris Link Editors: 5.10-1.489
    ld: warning: symbol `clog' has differing types:
    (file /opt/SUNWspro/lib/CC4/libC.so type=OBJT; file /usr/lib/libm.so type=FUNC);
    /opt/SUNWspro/lib/CC4/libC.so definition taken
    Undefined first referenced
    symbol in file
    TIFFOpenMem ../lib/FPCSolaris10/libIXA.a(IXA_ImageManager.o)
    ld: fatal: Symbol referencing errors. No output written to FPCSolaris10/MainItls_ils
    gmake[1]: *** [FPCSolaris10/MainItls_ils] Error 1
    But if I analyse the libraries used the missing symbol is actually there:
    nm -g ../lib/FPCSolaris10/libtiff.a
    ../lib/FPCSolaris10/libtiff.a[tif_msrc.o]:
    [Index] Value Size Type Bind Other Shndx Name
    [26] | 0| 0|FUNC |GLOB |0 |UNDEF |TIFFClientOpen
    [22] | 0| 0|FUNC |GLOB |0 |UNDEF |TIFFError
    [24] | 416| 161|FUNC |GLOB |0 |2 |TIFFOpenMem
    [23] | 0| 0|FUNC |GLOB |0 |UNDEF |free
    [25] | 0| 0|FUNC |GLOB |0 |UNDEF |malloc
    [21] | 0| 0|FUNC |GLOB |0 |UNDEF |memcpy
    Does anybody have an idea of what's wrong ?
    Thank you for your help!

    The libraries are probably being linked in the wrong order.
    Libraries are processed in the order seen on the link command. When the linker sees an archive library (.a), it pulls in any .o files from it that can satisfy existing undefined references. Suppose libA needs f1 from library libtiff, but -lA appears on the command line after -ltiff. The reference will not be resolved.
    Move the -ltiff option to a spot later on the command line, after all libraries that use libtiff, but before any libraries that libtiff uses. If libraries have circular references (A uses B which uses A), leave -ltiff where it is, but add another one later on the command line. The library will be searched twice.
    Another option is to build libtiff as a shared library (.so). The position on the link command line of a shared library is less sensitive, and references to it from later files can still be resolved. You don't list a shared library twice.
    An unrelated question: Why are you using the -compat=4 option? That option is provided to allow linking code that was compiled by C++ 4.2 (shipped in 1996), or compiling code that predates the 1998 C++ Standard.
    You usually cannot mix -compat=4 binaries with standard-mode binaries, you can't use the C++ standard library in -compat=4 mode, and code using C++ features introduced after the ARM (1991) won't compile in -compat=4 mode. Unless you are stuck with 10-year-old binaries built with C++ 4.2, it is best to recompile all your code in default standard mode (without -compat=4).
    The C++ Migration Guide explains all the issues involved in converting code from old-style to standard C++.
    [http://docs.sun.com/app/docs/doc/819-3689|http://docs.sun.com/app/docs/doc/819-3689]

  • C++ linking error Undefined symbols  AIX 5.3 xlC  bdb 4.7

    I am getting the following linking error while linking the MyCb example given in Berkley DB guide
    xlC -bnoquiet -o /ra2/frt_bld/TMPBIN/BDBtest \
    /ra2/frt_bld/TMPOBJ/DBAbs.o \
    /ra2/frt_bld/TMPOBJ/MyDb.o \
    /ra2/frt_bld/TMPOBJ/PPNum.o \
    /ra2/frt_bld/TMPOBJ/PPNumStore.o \
    /ra2/frt_bld/TMPOBJ/PPNumStoreDB.o \
    /ra2/frt_bld/TMPOBJ/UTDbtest.o \
    /ra2/frt_bld/TMPOBJ/UTPPNUm.o \
    -lC_r ../../../ACE_wrappers/ace/libACE.so -ldb_cxx -L../../../db-4.7.25/build_unix -L/usr/local/ssl -L/../../../ACE_wrappers/ace -lcrypto -lpthread -lz -lm -o /ra2/frt_bld/TMPBIN/BDBtest
    ld: 0711-318 ERROR: Undefined symbols were found.
    The following symbols are in error:
    Symbol Inpndx TY CL Source-File(Object-File) OR Import-File{Shared-object}
    RLD: Address Section Rld-type Referencing Symbol
    .Db::set_error_stream(std::basic_ostream<char,std::char_traits<char> >*) [1010] ER PR MyDb.cpp(/ra2/frt_bld/TMPOBJ/MyDb.o)
    00003b50 .text R_RBR [148] .MyDb::MyDb(std::basic_string<char,std::char_traits<char>,std::allocator<char> >&,std::basic_string<char,std::char_traits<char>,std::allocator<char> >&)
    .Db::open(DbTxn*,const char*,const char*,DBTYPE,unsigned int,int) [1012] ER PR MyDb.cpp(/ra2/frt_bld/TMPOBJ/MyDb.o)
    00003b84 .text R_RBR [148] .MyDb::MyDb(std::basic_string<char,std::char_traits<char>,std::allocator<char> >&,std::basic_string<char,std::char_traits<char>,std::allocator<char> >&)
    ER: The return code is 8.
    ld: 0711-317 ERROR: Undefined symbol: .Db::open(DbTxn*,const char*,const char*,DBTYPE,unsigned int,int)
    // File: MyDb.cpp
    #include "MyDb.h"
    #include <string>
    #include <iostream>
    // Class constructor. Requires a path to the location
    // where the database is located, and a database name
    MyDb::MyDb(std::string &path, std::string &dbName)
    : db_(NULL, 0), // Instantiate Db object
    dbFileName_(path + dbName), // Database file name
    cFlags_(DB_CREATE) // If the database doesn't yet exist,
    // allow it to be created.
    try
    // Redirect debugging information to std::cerr
    db_.set_error_stream( static_cast<std::ostream *>(&std::cerr) );
    // Open the database
    db_.open(NULL, dbFileName_.c_str(), NULL, DB_BTREE, cFlags_, 0);
    // DbException is not a subclass of std::exception, so we
    // need to catch them both.
    catch(DbException &e)
    std::cerr << "Error opening database: " << dbFileName_ << "\n";
    std::cerr << e.what() << std::endl;
    catch(std::exception &e)
    std::cerr << "Error opening database: " << dbFileName_ << "\n";
    std::cerr << e.what() << std::endl;
    //And then we need the implementation for the close() method:
    // Private member used to close a database. Called from the class
    // destructor.
    void
    MyDb::close()
    // Close the db
    try
    db_.close(0);
    std::cout << "Database " << dbFileName_
    << " is closed." << std::endl;
    catch(DbException &e)
    std::cerr << "Error closing database: " << dbFileName_ << "\n";
    std::cerr << e.what() << std::endl;
    catch(std::exception &e)
    std::cerr << "Error closing database: " << dbFileName_ << "\n";
    std::cerr << e.what() << std::endl;
    Thanks
    Anand Rathi
    Edited by: user10127683 on Jun 10, 2009 9:02 AM

    Hi Anand,
    http://www.oracle.com/technology/documentation/berkeley-db/db/ref/build_unix/aix.html <-- check FAQ #4.
    Please use a "-D_LARGE_FILES=1" when building BDB on AIX.
    Let me know how it works.
    Thanks,
    Bogdan Coman

  • Undefined symbols:   "___gxx_personality_v0$non_lazy_ptr",referenced from:

    Hi,
    I am getting following error while building . I tried searching on web as well for this error,but could not find a solution, suited for my problem. Searching on the web, I found two solutions :
    1.      Either use the compiler g++.
    2.      Add library stdc++ on the command, so that libstdc++ can be linked with.
    Actually both results are almost same, since g++ itself adds libstdc++ to the command before linking.
    I tried this solution, but it didn’t solve the problem. Thedifference between my problem and problem described on web is that in my case,undefined symbol is ___gxx_personality_v0$non_lazy_ptr,while all other problems described on web, describes missing___gxx_personality_v0. I tried searching for ___gxx_personality_v0$non_lazy_ptr in the libstdc++ and other libs as well using “nm”, but could not find this symbol.
    If anybody has any clue about tthis problem, please let me know.
    /usr/bin/cc  -prebind -o PROD "other .o's" "other libs"   -lgcc_eh
    Undefined symbols:
      "___gxx_personality_v0$non_lazy_ptr",referenced from:
    Error Icould found on web :
    Undefinedsymbols:
    "___gxx_personality_v0", referencedfrom:      è problems other encountered was that undefined symbol was__gxx_personality_v0.
    ___gxx_personality_v0$non_lazy_ptrin cciIlcV9.o  è In my case (see in my message), this is the undefined symbol. "std::basic_ostream<char,std::char_traits<char> >& std::endl<char,std::char_traits<char> >(std::basic_ostream<char,std::char_traits<char> >&)", referenced from:
    __ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_$non_lazy_ptrin cciIlcV9.o
    "std::ios_base::Init::~Init()",referenced from:
    Thanks& Regards,

    You're very welcome

  • Occidml undefined symbol problem

    Using 9i rel 2 and Solaris 6.1 I get the following error when building:
    $ make -f demo_rdbms.mk occidml
    Undefined symbol first referenced in file
    std::basic_string<char,std::char_traits<char>,dtd::allocator<char>>std::basic_string<char,std::char_traits<char>,std::allocator<char>>::__sun_concat(const std::basic_string<char,std::char_traits<char>,std::allocator<char>>&)const /cots/oracle/product/9.2.0.1/lib//liocci.so
    std::basic_string<char,std::char_traits<char>,dtd::allocator<char>>std::basic_string<char,std::char_traits<char>,std::allocator<char>>::__sun_concat(const char*)const /cots/oracle/product/9.2.0.1/lib//liocci.so
    Thanks for any help you can give me.

    Not a Solaris person, but it looks like it is missing the C++ STL header files/libraries.

  • Make std::basic_ostream ... error ?

    /usr/include/c++/3.3.3/ostream:436: error:
       std::basic_ostream<_CharT, _Traits>&
       std::operator<<(std::basic_ostream<_CharT, _Traits>&, char) [with _CharT =
       char, _Traits = std::char_traits<char>] <near match>
    Can someone help me to decode what the problem could be? I have no idea in what direction to go.

    My guess is that the software was written for an older version of C++ that doesn't support templates or the new stream stuff.  Does the package's website give any indications about what is needed in order to compile it?  gcc versions, etc?

  • Linker error:  ild: (undefined symbol)

    I am porting a large pack of C++ from AIX to Solaris. All the modules now passed compilation. But the linker (incremental loader) complains about undefined symbol, such as
    ild: (undefined symbol) __rwstd::__rb_tree<CString,std::pair<const CString,int>,__rwstd::__select1st<std::pair<const CString,int>,CString>,std::less<CString>,std::allocator<std::pair<const CString,int> > >::iterator __rwstd::__rb_tree<CString,std::pair<const CString,int>,__rwstd::__select1st<std::pair<const CString,int>,CString>,std::less<CString>,std::allocator<std::pair<const CString,int> > >::erase(__rwstd::__rb_tree<CString,std::pair<const CString,int>,__rwstd::__select1st<std::pair<const CString,int>,CString>,std::less<CString>,std::allocator<std::pair<const CString,int> > >::iterator,__rwstd::__rb_tree<CString,std::pair<const
    CString,int>,__rwstd::__select1st<std::pair<const String,int>,CString>,std::less<CString>,std::allocator<std::pair<const CString,int> > >::iterator) -- referenced in the text segment of ../Release/solaris/libSpiderWeb.a(SpiderCommand.o)
    ild: (undefined symbol) void std::list<const Process*,std::allocator<const Process*> >::__deallocate_buffers() -- referenced in the text segment of ../Release/solaris/libDragline.a(SystemScope.o)
    I did not explicitly use those functions for sure. However, when I link a small test program using std::list and/or std::map which had at least __deallocate_buffers after template instantiation, the linker did not complain.
    Any insighgt? What could be the problem and what is the fix?
    BTW I am on SunOS 5.6 sun4u sparc SUNW,Ultra-2 and use compiler Sun WorkShop 6 2000/04/07 C++ 5.1.
    Thanks a lot!
    Lan

    There is no Solaris 6.2. To find the Solaris version, run the command
    uname -a
    Probably you mean Sun Workshop (or Forte Developer) 6 update 2. (The name of the product changed mid-stream, from "Sun Workshop" to "Forte Developer", and now is "Sun Studio".)
    To find the compiler version, run the command
    CC -V
    For Workshop 6u2, the CC version is 5.3.
    For old compiler versions like this, problems with missing template definitions can usually be fixed by clearing the template cache and rebuilding. To clear the template cache, you can just remove the directory SunWS_cache, or more conservatively, run the command
    CCadmin -clean
    There will be a cache directory in every directory where you create .o files. You need to clean all of them.
    Starting with Sun Studio 8 (C++ 5.5) in 2003, the compiler no longer uses a template cache by default. These kinds of problems no longer occur.
    You really should stop using the old compiler, and get a current one. The later compilers run faster, generate code that runs faster, are more standard-conforming, support modern hardware, and have superior program development tools (compiler, debugger, performance analyzer, thread analyzer). Best of all, the current compilers are completely free for all uses. The only license is the license you click to accept when you download the product.
    If you are running on Solaris 8, get Sun Studio 11 here:
    [http://developers.sun.com/sunstudio/products/previous/11/index.jsp]
    If you are running on Solaris 9, Solaris 10, Solaris Express, or Open Solaris, get the current release, Sun Studio 12:
    [http://developers.sun.com/sunstudio/]

Maybe you are looking for