NicoCaldo Posted April 4, 2020 Report Share Posted April 4, 2020 So, I'm trying to compile my main.cpp that includes three modules. For instance I got a module counter with this .h file #include <systemc.h> SC_MODULE(counter) { sc_in<bool> clk; //porta ingresso clock sc_in<bool> load; //porta ingresso load sc_in<bool> clear; //porta ingresso clear sc_in<sc_uint<8> > din; //porta ingresso dato (intero 8 bit) sc_out<sc_uint<8> > dout; //porta uscita dato (intero 8 bit) unsigned int countval; //valore del contatore (intero senza segno) void counting(); //funzione conteggio (il mio processo) SC_CTOR(counter) { //costruttore di counting() SC_METHOD(counting); //costruttore del mio processo attraverso metodo (meglio del thread) sensitive << clk.pos(); //sensibile al fronte del clock, positivo } }; now, when I run the compiler with g++ -I/usr/local/systemc-2.3.3/include -L/usr/local/systemc-2.3.3/lib-linux64/ -lsystemc -lm -o out main.cpp but I got this error /tmp/ccz92lN5.o: In function `counter::counter(sc_core::sc_module_name)': main.cpp:(.text._ZN7counterC2EN7sc_core14sc_module_nameE[_ZN7counterC5EN7sc_core14sc_module_nameE]+0xba): undefined reference to `counter::counting()' How do I fix it? Quote Link to comment Share on other sites More sharing options...
NicoCaldo Posted April 4, 2020 Author Report Share Posted April 4, 2020 Ok find the issue. I needed to compile all the .cpp dependencies as well with g++ -I/usr/local/systemc-2.3.3/include -L/usr/local/systemc-2.3.3/lib-linux64/ -lsystemc -lm -o out counter.cpp shifter.cpp testbench.cpp main.cpp 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.