ubuntu16.04环境下,make一个systemc程序,发现编译错误:
systemc-2.3.1/include/sysc/datatypes/int/sc_uint_base.h:842: undefined reference to sc_dt::sc_uint_base::to_string(sc_dt::sc_numrep, bool) const' systemc-2.3.1/include/sysc/communication/sc_signal_ports.h:1802: undefined reference to
sc_core::sc_in::add_trace_internal
….
collect2: error: ld returned 1 exit status
出现此错误,很有可能是由于当前环境的默认gcc版本比较低,而安装systemc时使用的gcc版本较高。导致当前低版本的gcc无法识别高版本编译过的systemc库文件。
一般ubuntu16.04环境下,对应的是gcc 5.4.0版本。
修改当前默认gcc的版本号可以参考
https://blog.youkuaiyun.com/qq_31175231/article/details/77774971