c++ - 对 'abc::abc()' 的 undefined reference ,矮错误 : Offset appearing

标签 c++ compiler-errors

我声明一个对象:

#include "abc.h"

class xxx
{
public: 
  xxx();
  ~xxx();
  abc* q;
...
};

在 .cpp 文件中,我执行以下操作

this->q=new abc(); <- undefined reference abc::abc() 的这一行错误

在控制台中也出现了这个错误:

Dwarf Error: Offset (76195) greater than or equal to .debug_str size (1472).

谁知道哪里出了问题?我正在使用 eclipse,fedora 14

最佳答案

undefined reference to abc::abc()

这是一个链接错误,告诉您链接器找不到 abc::abc() 的定义。

最有可能的是,您只声明但没有定义类 abc 的无参数构造函数。
在你的 cpp 文件中你应该有:

abc::abc()
{

}

如果你已经有了它,你应该确保具有这个定义的源 cpp 文件被正确地链接到你的项目。

关于c++ - 对 'abc::abc()' 的 undefined reference ,矮错误 : Offset appearing,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9922721/

相关文章:

c++ - 如何使 MFC CToolbar 按钮大小对于 Windows 7/10 上的高 DPI 感知应用程序更加一致

c - GCC 提示缺少对同一文件中函数的引用

java - 找不到符号 .peek()

c - 错误 : expected identifier or ‘(’ before ‘__extension__’

c - 数值积分法、中点、误差、C 代码

swift 3、iOS 10 - 错误 : Thread 1 Signal Sigabrt (SPRITEKIT)

带有模板、运算符重载和 boost::bind 的 C++ - 这个小代码有什么作用?

c++ - 如何从C++中的字符串ID中提取int日、月和年

c++ - 无法将 boost 库连接到我的项目 "symbol lookup error"

c++ - 使用 C++ 和 map/unordered_map : the default value for a non-existant key 创建直方图