johnnie.chan@gmail.com Posted March 7, 2013 Report Share 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 Link to comment Share on other sites More sharing options...
sumit_tuwien Posted March 7, 2013 Report Share Posted March 7, 2013 Please share the compiler/linker command you have used. Regards, Sumit Quote Link to comment Share on other sites More sharing options...
johnnie.chan@gmail.com Posted March 7, 2013 Author Report Share 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 Link to comment Share on other sites More sharing options...
sumit_tuwien Posted March 7, 2013 Report Share 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 johnnie.chan@gmail.com 1 Quote Link to comment Share on other sites More sharing options...
maehne Posted March 7, 2013 Report Share 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 johnnie.chan@gmail.com and sumit_tuwien 2 Quote Link to comment Share on other sites More sharing options...
maehne Posted March 7, 2013 Report Share Posted March 7, 2013 Sumit, what a coincidence. :-) Quote Link to comment Share on other sites More sharing options...
sumit_tuwien Posted March 7, 2013 Report Share Posted March 7, 2013 Exactly Quote Link to comment Share on other sites More sharing options...
johnnie.chan@gmail.com Posted March 7, 2013 Author Report Share Posted March 7, 2013 Thanks for the fix and the explanation! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.