johnnie.chan@gmail.com 0 Report post Posted March 7, 2013 I'm getting the following error when trying to compile anything that includes the systemc-ams library: #include <systemc-ams.h> int sc_main(int argc, char* argv[]) { return 0; } The following error arises: /tmp/ccWqxyVs.o: In function `sca_util::sca_implementation::sca_matrix_base<double>::~sca_matrix_base()': /home/johnnie/systemc-ams-1.0/include/scams/impl/util/data_types/sca_matrix_base.h:172: undefined reference to `sca_util::sca_implementation::sca_matrix_base_typeless::~sca_matrix_base_typeless()' /home/johnnie/systemc-ams-1.0/include/scams/impl/util/data_types/sca_matrix_base.h:172: undefined reference to `sca_util::sca_implementation::sca_matrix_base_typeless::~sca_matrix_base_typeless()' /tmp/ccWqxyVs.o:(.rodata._ZTIN8sca_util18sca_implementation15sca_matrix_baseIdEE[_ZTIN8sca_util18sca_implementation15sca_matrix_baseIdEE]+0x10): undefined reference to `typeinfo for sca_util::sca_implementation::sca_matrix_base_typeless' Can anyone help provide insight into what is going on? Quote Share this post Link to post Share on other sites
sumit_tuwien 24 Report post Posted March 7, 2013 Please share the compiler/linker command you have used. Regards, Sumit Quote Share this post Link to post Share on other sites
johnnie.chan@gmail.com 0 Report post Posted March 7, 2013 g++ -Wall -DDEBUG -g -I/home/johnnie/systemc-2.3.0/include -I/home/johnnie/systemc-ams-1.0/include -Iinclude/ -L/home/johnnie/systemc-2.3.0/lib-linux64 -L/home/johnnie/systemc-ams-1.0/lib-linux64 -lsystemc-ams -lsystemc test/main.cpp -o a Quote Share this post Link to post Share on other sites
sumit_tuwien 24 Report post Posted March 7, 2013 Use: g++ test/main.cpp -Wall -DDEBUG -g -I/home/johnnie/systemc-2.3.0/include -I/home/johnnie/systemc-ams-1.0/include -Iinclude/ -L/home/johnnie/systemc-2.3.0/lib-linux64 -L/home/johnnie/systemc-ams-1.0/lib-linux64 -lsystemc-ams -lsystemc -o a 1 johnnie.chan@gmail.com reacted to this Quote Share this post Link to post Share on other sites
maehne 69 Report post Posted March 7, 2013 You are not passing the parameters in the right order to the compiler. Recent versions of g++ only include a library if one of its symbols is actually used in one of the preceding object files. Try the following command with the link libraries at the end of the compiler call: g++ -Wall -DDEBUG -g -o main test/main.cpp -I/home/johnnie/systemc-2.3.0/include -I/home/johnnie/systemc-ams-1.0/include -Iinclude/ -L/home/johnnie/systemc-2.3.0/lib-linux64 -L/home/johnnie/systemc-ams-1.0/lib-linux64 -lsystemc-ams -lsystemc 2 johnnie.chan@gmail.com and sumit_tuwien reacted to this Quote Share this post Link to post Share on other sites
maehne 69 Report post Posted March 7, 2013 Sumit, what a coincidence. :-) Quote Share this post Link to post Share on other sites
sumit_tuwien 24 Report post Posted March 7, 2013 Exactly Quote Share this post Link to post Share on other sites
johnnie.chan@gmail.com 0 Report post Posted March 7, 2013 Thanks for the fix and the explanation! Quote Share this post Link to post Share on other sites