linking error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • pradeep

    linking error

    hi,
    I am getting the following error when compiling my c++ program using
    g++3.2
    Thanks for any help.

    In function `TreeNode::Tree Node[in-charge](QListView*, QString
    const&, Indic::Node*)':
    ..obj/tree_gui.o(.tex t+0x173): undefined reference to `vtable for
    TreeNode'

    I have a simple class TreeNode and pointer of the same class in the
    class

    thanks
    pradeep
  • Kevin Goodsell

    #2
    Re: linking error

    pradeep wrote:
    [color=blue]
    > hi,
    > I am getting the following error when compiling my c++ program using
    > g++3.2
    > Thanks for any help.
    >
    > In function `TreeNode::Tree Node[in-charge](QListView*, QString
    > const&, Indic::Node*)':
    > .obj/tree_gui.o(.tex t+0x173): undefined reference to `vtable for
    > TreeNode'
    >
    > I have a simple class TreeNode and pointer of the same class in the
    > class
    >
    > thanks
    > pradeep[/color]

    Isn't it obvious? You have a bug on line 42.

    -Kevin
    --
    My email address is valid, but changes periodically.
    To contact me please use the address from a recent posting.

    Comment

    • Janusz Szpilewski

      #3
      Re: linking error

      pradeep wrote:[color=blue]
      > hi,
      > I am getting the following error when compiling my c++ program using
      > g++3.2
      > Thanks for any help.
      >
      > In function `TreeNode::Tree Node[in-charge](QListView*, QString
      > const&, Indic::Node*)':
      > ..obj/tree_gui.o(.tex t+0x173): undefined reference to `vtable for
      > TreeNode'
      >
      > I have a simple class TreeNode and pointer of the same class in the
      > class
      >[/color]

      This error message suggests that the virtual method table of the class
      TreeNode was not generated by the compiler. It happens when the first
      non-inline virtual member function is not defined (implemented). So
      check if it is the case in your code.

      Regards,
      Janusz

      Comment

      Working...