[C++-sig] undefined symbol problem help

Grant grant.tang at gmail.com
Thu May 1 22:33:20 CEST 2008


That's exactly the cause of this import error.
Renderer has a viutual destructor which is not defined:
virtual ~Renderer();

I change it to 
virtual ~Renderer() {}

The problem solved. Thank you Gustavo!
Grant
  "Gustavo Carneiro" <gjcarneiro at gmail.com> wrote in message news:a467ca4f0805010917l60c83757v33a7b878ef68cbd5 at mail.gmail.com...



  2008/5/1 Grant <grant.tang at gmail.com>:

    I made a mistake, the result of

    $ nm libGORGON.so | grep _ZTIN8wustl_mm13Visualization8RendererE

    $ U _ZTIN8wustl_mm13Visualization8RendererE

  gjc at dark-tower:~$ c++filt -t _ZTIN8wustl_mm13Visualization8RendererE
  typeinfo for wustl_mm::Visualization::Renderer

  As for the reasons for the problem, could be several, you have to google it.  I found this:

  http://www.dbforums.com/archive/index.php/t-352689.html

  In which they say one of the possible reasons is the class missing the implementation of a virtual function.

  Hope it helps.




    I build Render.cpp into libGORGON.so, really don't know why this symbol is
    undefined.

    "Grant" <grant.tang at gmail.com> wrote in message
    news:fvav9j$t8r$1 at ger.gmane.org...

    >I need wrap a project into Python. All C++ classes are built as a shared
    >library libGORGON.so. The boost.python wrapper file is built as
    >libpyGORGON.so. But when I try to import libpyGORGON in Python prompt. I
    >got error:
    >
    > Python 2.4.4 (#1, Oct 23 2006, 13:58:18) [GCC 4.1.1 20061011 (Red Hat
    > 4.1.1-30)] on linux2 Type "help", "copyright", "credits" or "license" for
    > more information.
    >>>> import libpyGORGON.so
    > Traceback (most recent call last):
    >  File "<stdin>", line 1, in ?
    > ImportError: /data2/Gorgon/lib/libGORGON.so: undefined symbol:
    > _ZTIN8wustl_mm13Visualization8RendererE
    >>>>
    >
    > I already set the LD_LIBRARY_PATH and PYTHONPATH to /data2/Gorgon/lib.
    >
    > I use ldd to check the libpyGORGON.so:
    > libGORGON.so => /data2/Gorgon/lib/libGORGON.so (0x00002aaaaadf0000)
    >        libboost_python.so.2 => /usr/lib64/libboost_python.so.2
    > (0x00002aaaab157000)
    >        libpython2.4.so.1.0 => /usr/lib64/libpython2.4.so.1.0
    > (0x00002aaaab395000)
    >        libGL.so.1 => /usr/lib64/libGL.so.1 (0x00002aaaab6ca000)
    >        libGLU.so.1 => /usr/lib64/libGLU.so.1 (0x00002aaaab88d000)
    >        libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00002aaaabb0d000)
    >        libm.so.6 => /lib64/libm.so.6 (0x00002aaaabe0e000)
    >        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00002aaaac091000)
    >        libc.so.6 => /lib64/libc.so.6 (0x00002aaaac29e000)
    >        libpthread.so.0 => /lib64/libpthread.so.0 (0x00002aaaac5ed000)
    >        libdl.so.2 => /lib64/libdl.so.2 (0x00002aaaac807000)
    >        libutil.so.1 => /lib64/libutil.so.1 (0x00002aaaaca0b000)
    >        libXext.so.6 => /usr/lib64/libXext.so.6 (0x00002aaaacc0f000)
    >        libX11.so.6 => /usr/lib64/libX11.so.6 (0x00002aaaace20000)
    >        /lib64/ld-linux-x86-64.so.2 (0x0000555555554000)
    >        libXau.so.6 => /usr/lib64/libXau.so.6 (0x00002aaaad12c000)
    >        libXdmcp.so.6 => /usr/lib64/libXdmcp.so.6 (0x00002aaaad32e000)
    >
    > And also I search the symbol in libGORGON.so:
    > $ nm libGORGON.so | grep _ZTIN8wustl_mm13Visualization8RendererE
    >
    > It actually finds the symbol. I am confused. Anybody help me out?
    >
    > By the way, I did not use bjam. I use cmake to create makefile for me.
    >
    > Thanks,
    > Grant



    _______________________________________________
    C++-sig mailing list
    C++-sig at python.org
    http://mail.python.org/mailman/listinfo/c++-sig




  -- 
  Gustavo J. A. M. Carneiro
  INESC Porto, Telecommunications and Multimedia Unit
  "The universe is always one step beyond logic." -- Frank Herbert 


------------------------------------------------------------------------------


  _______________________________________________
  C++-sig mailing list
  C++-sig at python.org
  http://mail.python.org/mailman/listinfo/c++-sig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20080501/e19ea17a/attachment.htm>


More information about the Cplusplus-sig mailing list