SystemC Verification构建错误'未定义引用...'

时间:2016-09-21 08:49:49

标签: cygwin verification systemc

我遇到的问题是无法构建包含任何SCV功能使用的代码。我正在使用Eclipse和Cygwin。 这是一个我正在尝试构建和运行的简单代码:

#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;
}

但它有很多错误,大多是重复自己。 这是他们中的第一个:

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)'

1 个答案:

答案 0 :(得分:0)

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