This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello,
I have a task of building a static library from C++ classes and source code which we eventually want to distribute to external customers. The challenge here is that I have lot of classes with templates and even bigger number of inline functions. As per information i have collected so far templates are not instatiates until they are used hence the user will get linking error when they will try to create and use template objects. Another problem is that I can make inline functions as a normal functions but then i have to pay performance penalty in terms of jump and pipeline flush.
So I wanted to know is there any workaround this so that I can still build the library with template classes and inline functions so that need not change the design of my existing code?
Or may be how others are sharing the software without sharing the source code with constraint as above?
I am using CCS4.0 and C2000 code generation tool 5.2.6.
I would appreciate your help.
Dinesh
Sorry, but there is no way to share template based library code without including the full source to the templates and the inline functions templates usually invoke. These templates and inline functions are usually in header files. That is how the STL functionality is supplied with recent versions of the TI compiler.
You'll also find this useful: http://processors.wiki.ti.com/index.php/C%2B%2B_Template_Instantiation_Issues
Thanks and regards,
-George