【问题标题】:Error when call API when running simulator运行模拟器时调用API出错
【发布时间】:2015-01-14 15:34:26
【问题描述】:

我正在使用从数据预取锦标赛 (http://www.jilp.org/dpc/prefetching_framework_description.html) 下载的一个软件框架。一切正常,但每次我尝试调用 API 时,系统提供的框架都会抛出一些错误。 例如,在 interface.h 文件中,它提供了一个 API: void SetPrefetchBit(UINT32 level, CacheAddr_t addr); 我在我的代码中调用它。代码可以成功编译和链接。但是当我运行代码时,它会抛出错误: PREF_KIT/runs/../pin/intel64/bin/pinbin:符号查找错误:/PREF_KIT/runs/../bin/CMPsim.usetrace:未定义符号:_Z14SetPrefetchBitjy

我真的对这个错误感到困惑。由于代码可以正确编译并与提供的静态库链接,这意味着应该提供 API。那么这个错误说明了什么?

感谢任何建议或建议。提前致谢

【问题讨论】:

    标签: c++ simulator prefetch


    【解决方案1】:

    我也有同样的问题。我在 64 位 Ubuntu 上运行并且可以正常编译,但是当我运行时,我得到了上面相同的错误。当我使用以下命令运行 nm 时:

    nm libCMPsim64.a | c++filt | grep GetPrefetch
    

    我知道库本身中有一个未定义的引用...

    0000000000001790 T GetPrefetchBit(unsigned int, unsigned long)
                     U CACHE::GetPrefetchBit(unsigned long, unsigned int)
    0000000000000000 r GetPrefetchBit(unsigned int, unsigned long)::__PRETTY_FUNCTION__
    00000000000003b0 T CACHE::GetPrefetchBit(unsigned long, unsigned int)
    

    【讨论】:

    • 是的,您已经找到了我认为的问题所在:) 您可以通过将函数 GetPrefetchBit 的声明更改为您在库中看到的内容来解决问题
    猜你喜欢
    • 1970-01-01
    • 2016-07-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-02-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多