首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >SystemC验证构建错误“未定义对..的引用”

SystemC验证构建错误“未定义对..的引用”
EN

Stack Overflow用户
提问于 2016-09-21 16:49:49
回答 1查看 1.1K关注 0票数 0

我有一个问题,就是不能构建任何包含SCV函数用法的代码。我使用的是Eclipse和Cygwin。这是我正在尝试构建和运行的一段简单代码:

代码语言:javascript
复制
#include <scv.h>

int sc_main (int argc, char* argv[]) {
// Int data type
int data = 100;
// Get the bitwidth of the data
int bitwidth = scv_get_extensions(data).get_bitwidth();
cout << "Width of data is "<< bitwidth << endl;
cout << "Value in data is ";
// Get the value in data and print to stdio
scv_get_extensions(data).print();
return 0;
}

但它有一大堆错误,大多数是重复出现的。这是它们中的前几个:

代码语言:javascript
复制
Building target: proba.exe
Invoking: Cygwin C++ Linker
g++ -L"C:/systemc-2.3.1/lib-cygwin" -o "proba.exe"  ./apb_transaction.o   -lsystemc -lscv
C:/systemc-2.3.1/lib-cygwin/libscv.a(libscv_la-scv_introspection.o): In function `_scv_extension_rw_sc_signed::write(sc_dt::sc_signed const&)':
/cygdrive/c/scv-2.0.0/objdir/src/scv/../../../src/scv/scv_introspection.cpp:1090: undefined reference to `sc_dt::sc_signed::operator=(sc_dt::sc_signed const&)'
/cygdrive/c/scv-2.0.0/objdir/src/scv/../../../src/scv/scv_introspection.cpp:1090:(.text+0xee54): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `sc_dt::sc_signed::operator=(sc_dt::sc_signed const&)'
C:/systemc-2.3.1/lib-cygwin/libscv.a(libscv_la-scv_introspection.o): In function `_scv_extension_rw_sc_signed::assign(long)':
/cygdrive/c/scv-2.0.0/objdir/src/scv/../../../src/scv/scv_introspection.cpp:1090: undefined reference to `sc_dt::sc_signed::operator=(long)'
/cygdrive/c/scv-2.0.0/objdir/src/scv/../../../src/scv/scv_introspection.cpp:1090:(.text+0xf04e): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `sc_dt::sc_signed::operator=(long)'
C:/systemc-2.3.1/lib-cygwin/libscv.a(libscv_la-scv_introspection.o): In function `_scv_extension_rw_sc_signed::assign(unsigned long)':
/cygdrive/c/scv-2.0.0/objdir/src/scv/../../../src/scv/scv_introspection.cpp:1090: undefined reference to `sc_dt::sc_signed::operator=(unsigned long)'
/cygdrive/c/scv-2.0.0/objdir/src/scv/../../../src/scv/scv_introspection.cpp:1090:(.text+0xf08a): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `sc_dt::sc_signed::operator=(unsigned long)'
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-09-21 20:35:40

我找到了答案!Here是它的链接,如果有人需要它的话!只需更改添加scv和systemc库的顺序即可。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39611720

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档