Closed a01163125 closed 2 years ago
Those are template functions, so they definitely fit inside a header file.
Knob.obj should have this symbol definition Knob<string>::setValue(const string&,...)
, since Knob.cpp ends with explicit template instantiations:
template class Knob<int>;
template class Knob<double>;
template class Knob<bool>;
template class Knob<std::string>;
Can you check if Knob.obj contains these symbols?
Those are template functions, so they definitely fit inside a header file. Knob.obj should have this symbol definition
Knob<string>::setValue(const string&,...)
, since Knob.cpp ends with explicit template instantiations:template class Knob<int>; template class Knob<double>; template class Knob<bool>; template class Knob<std::string>;
Can you check if Knob.obj contains these symbols?
Thank you! I have solved this problem by copying functions into H file. And engine is a lib instead of exe project. I forgot to close this question. And, how can I check if Knob.obj contains these symbols?
And, how can I check if Knob.obj contains these symbols?
Simply you can use dumpbin
from the MSVC toolkit or llvm-nm
from LLVM/Clang. Closing since this question was solved.
Hi, I found a list of errors of unresolved external symbols like:
I am using Visual Studio 2019 on Win10 with Natron 2.5.
I am sure that it is a commonsense no defining functions in H file as this behaviour will cause "already defined" error when this function been called from more than one file. However I found that KnobImpl.h implemented many methods of Knob.h and only been included by Knob.cpp and when I compile it I found many 2001 errors. So how can I solve this problem? Should I change this into a cpp file or did I missed any settings in VS?