H
Hans
Hi All,
In the stripped down code example below Visual C++ 2005 issues the following
error:
error LNK2019: unresolved external symbol "public: void __thiscall
Addsub<24>::do_process123(void)"
This is a SystemC example, however I believe this is a basic C++ syntax
error since if I move the Addsub function inside the Addsub class (that is
delete File2) then all is OK so I must have made a mistake in the template
definition?
Thanks,
Hans.
// File 1 addsub.h
template <int ADDSUB_WIDTH=24>
SC_MODULE(Addsub)
{
void do_process123(); // fails
void do_process123() {}; // works, excl addsub.cpp
SC_CTOR(Addsub) {
SC_METHOD(do_process123);
}
};
// File 2 addsub.cpp
template <int ADDSUB_WIDTH>
void Addsub<ADDSUB_WIDTH>::do_process123(){}
// File 3 top.h
#include "addsub.h"
#define WIDTH 24
SC_MODULE(Cordic) {
public:
Addsub<WIDTH> ADD1;
void do_process1() { }
SC_CTOR(Cordic) : ADD1("ADD1") {
SC_METHOD(do_process1);
}
};
In the stripped down code example below Visual C++ 2005 issues the following
error:
error LNK2019: unresolved external symbol "public: void __thiscall
Addsub<24>::do_process123(void)"
This is a SystemC example, however I believe this is a basic C++ syntax
error since if I move the Addsub function inside the Addsub class (that is
delete File2) then all is OK so I must have made a mistake in the template
definition?
Thanks,
Hans.
// File 1 addsub.h
template <int ADDSUB_WIDTH=24>
SC_MODULE(Addsub)
{
void do_process123(); // fails
void do_process123() {}; // works, excl addsub.cpp
SC_CTOR(Addsub) {
SC_METHOD(do_process123);
}
};
// File 2 addsub.cpp
template <int ADDSUB_WIDTH>
void Addsub<ADDSUB_WIDTH>::do_process123(){}
// File 3 top.h
#include "addsub.h"
#define WIDTH 24
SC_MODULE(Cordic) {
public:
Addsub<WIDTH> ADD1;
void do_process1() { }
SC_CTOR(Cordic) : ADD1("ADD1") {
SC_METHOD(do_process1);
}
};