English 中文(简体)
未界定的符号。 原件:无
原标题:Undefined symbols. ld: symbol not found

除这一未界定的符号错误外,一切都在发挥作用:

bash-3.2$ make
g++ -Wall -g solvePlanningProblem.o Position.o AStarNode.o PRM.o PRMNode.o Worl.o SingleCircleWorld.o Myworld.o RECTANGLE.o CIRCLE.o -o solvePlanningProblem

`Undefined symbols:
  "Obstacle::~Obstacle()", referenced from:
      Myworld::~Myworld()in Myworld.o
      Myworld::~Myworld()in Myworld.o
      Myworld::~Myworld()in Myworld.o
  "RECTANGLE::RECTANGLE()", referenced from:
      Myworld::readObstacles(std::basic_istream<char, std::char_traits<char> >&
in Myworld.o
  "CIRCLE::CIRCLE()", referenced from:
      Myworld::readObstacles(std::basic_istream<char, std::char_traits<char> >&
in Myworld.o
  "typeinfo for Obstacle", referenced from:
      typeinfo for RECTANGLEin RECTANGLE.o
      typeinfo for CIRCLEin CIRCLE.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [solvePlanningProblem] Error 1`

It s such a strange error. Is something wrong with the constructor or destructor? Any advice will help.

After adding {} after all constructors and destructors the error has been reduced to:

Undefined symbols:

  "vtable for Obstacle", referenced from:
      Obstacle::Obstacle()in Myworld.o
  "typeinfo for Obstacle", referenced from:
      typeinfo for RECTANGLEin RECTANGLE.o
      typeinfo for CIRCLEin CIRCLE.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
问题回答

联系人可以发现奥斯塔奇班的主子。

它是否属于另一个物体档案(perhaps Obstacle.o)? 如果是的话,在物体清单中添加这一点。

它是否应当成为阶级定义中的空洞虚拟脱轨者? 在此情况下,确保你写书面材料。

virtual ~Obstacle() {}

而不是

virtual ~Obstacle();

第一项措施是执行停火者;第二项声明是存在,但在其他地方执行。

象你这样的人没有执行“主子”栏。 这是界定的。

LD是联系人,这意味着所有东西都汇编了罚款,但当它开始把双筒连接在一起时,它就能够找到你法典中使用的“主人”。

增 编

~Obstacle() {}

缩略语

或许是你宣布Der,但却没有执行。 1. 将{}列入档案,或:

Obstacle::~Obstacle()
{
}

参看第2页。

它还认为,从RECTANGLE和CIRCLE中遗漏了违约构件。

你没有图书馆。 或者有一套破碎的工具链(这取决于电动途径)。

页: 1





相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签