【问题标题】:Typeinfo for ocl::CRExceptionocl::CRException 的类型信息
【发布时间】:2013-03-26 14:54:55
【问题描述】:

我尝试使用 g++ 运行我的 C++ 程序,但出现以下异常: "typeinfo for ocl::CRException" 正在使用包含 CRException 类的 ocl 命名空间。请帮帮我。

这是包含 OCL 类的代码:

#ifndef VOIDSOFT_ADA2_LIND_HH

#define VOIDSOFT_ADA2_LIND_HH
#include <string>
#include <list>
#include <queue>
#include <map>
#include <ocl.h>
#include "threaded.hh"

using namespace std;
using namespace ocl;

class circuit;

class Lind: public Threaded 
{
public:
    typedef int lookup_t;

private:
    OraConnection connection;
    pthread_mutex_t *done_m;
    queue<pthread_t> *q;
    lookup_t type;

public:
    circuit *c;
    Lind();
    ~Lind();

    void *run();    

    map<string, pair<string, string> > *getnodes(string);

    bool connect();
    void disconnect();

private:
    circuit *getcircuitinfo(string, circuit *c = 0);               
    void bindInStr(OraQuery &q, string arg, string bindvar, map<string, string> *properties);

    map<string, pair<string, string> > *node2name(string);
};

/* Lookup types */
namespace LindLookupTypes {
    /* Get overlying */
    const int OL = 0x001;
    /* Get underlying */
    const int UL = 0x002;
}
#endif /* VOIDSOFT_ADA2_LIND_HH */

【问题讨论】:

    标签: c++ linux g++ exception-specification


    【解决方案1】:

    这通常意味着您忘记在某处定义(实现)虚拟方法。检查ocl::CRException 的所有虚方法是否已定义,以及定义它们的目标文件是否实际链接到您的代码。

    如果没有帮助,请编辑答案并向我们展示CRException 的代码。

    【讨论】:

    • 会不会是版本问题?我在 GCC 2.3 中编写了代码,并在 GCC 3.4 中编译了相同的代码。我清除了许多错误。现在程序正在正确编译但得到ocl::CRException ..由于版本更改我需要更改任何东西吗??
    • @viswa:很难猜,但肯定有可能。如果您可以发布一些代码,最好是SSCCE,我们也许可以帮助您。只需编辑答案,然后之后,回复此评论,以便通知我有一些代码可供查看。
    • 我添加了包含 ocl 命名空间的代码。此代码首先在 gcc 2.x 中编译,现在在 4.6 中编译相同。它显示了许多编译时错误,我通过小改动修复了所有这些错误,现在它显示“未定义符号:_ZTIN3ocl11CRExceptionE”,即 ocl::CRExpection
    • @viswa:您展示的代码几乎肯定不是问题所在。由于您在 GCC 版本上做了很大的改进,请确保您重新编译/重新安装了 OCL,如果问题仍然存在,请尝试。
    • 我之前重新安装了 ocl,但仍然遇到同样的错误。我什至检查了我的 makefile 中的 lib 目录,它与我安装的目录相同
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-04-07
    • 2022-01-26
    • 1970-01-01
    • 2021-08-20
    • 2019-03-03
    • 2010-10-21
    • 2017-06-21
    相关资源
    最近更新 更多