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.

#306 no instance of function template for C++

Other Parts Discussed in Thread: AM1808, TMS320C6678

I'm working on C++ project on CCSv5.2 with C5505 DSP.

While i compiling i got the following error but if i compile for PC environment it's working properly.

#306 no instance of function template "FingerJetFxOSE::FpRecEngineImpl::Embedded::oct_sign" matches the argument list argument types are: (std::complex<int32>, long) detected during: instantiation of "void FingerJetFxOSE::FpRecEngineImpl::Embedded::FeatureExtractionImpl::raw_orimap<stride,ori_scale>(std::size_t, std::size_t, const uint8 *, bool, FingerJetFxOSE::FpRecEngineImpl::Embedded::FeatureExtractionImpl::ori_t *, uint8 *) [with stride=256U, ori_scale=4U]" at line 262 instantiation of "void FingerJetFxOSE::FpRecEngineImpl::Embedded::FeatureExtractionImpl::orientation_map_and_footprint<stride,ori_scale>(std::size_t, std::size_t, const uint8 *, bool, FingerJetFxOSE::FpRecEngineImpl::Embedded::FeatureExtractionImpl::ori_t *, uint8 *) [with stride=256U, ori_scale=4U]" orimap.h /test/include line 130 C/C++ Problem

What is the reason for this error in CCS is there we need to add any header function to CCS because same project working fine in UBUNTU system.

4111.complex.h

6180.orimap.h  

  • It's hard to tell because you didn't attach some of the header files included by orimap.h  I recommend you create the smallest C++ file which reproduces the error, preprocess that with the --preproc_only command-line option and attach that.  If I had to guess, I would say that this has to do with the fact that on C55x, int is 16 bits.  Function oct_sign wants arguments of type (std::complex<T>, T), but it's getting (std::complex<int32>, long).  Check that int32 is a typedef for long, not int.  You might be able to get the error to go away if you use int32(50000) instead of 50000, but make sure that int32 isn't int.

  • Hi 

    I tried int32(50000) but i got other error that is 

    Description Resource Path Location Type
    #10099-D program will not fit into available memory. placement with alignment/blocking fails for section ".text" size 0x3f67e page 0. Available memory ranges: SARAM1 size: 0x20000 unused: 0x1 max hole: 0x1 SARAM2 size: 0xfe00 unused: 0x4 max hole: 0x3 SARAM0 size: 0x10000 unused: 0x3 max hole: 0x3 C5505.cmd /test line 50 C/C++ Problem

    I've sent the files to you kindly check it and please correct it.

    Thanks

    Sangly

  • I'm still looking at the test case you sent, but from the linker map file (test.map) I can tell you that this program is nearly too big to fit in the memory specified in C5505.cmd.  DARAM0, SARAM0, SARAM1, and SARAM2 together total 320 KB.  The .text section alone is approximately 253 KB.  There is unused space in DARAM0 that could be used to allocate the rest of .text.  Change C5505.cmd to allow .text to be split into DARAM0, like so:

    SECTIONS
    {
        .text >> SARAM1 | SARAM2 | SARAM0 | DARAM0
    

    If you make this program any bigger, it will probably not fit.  As it is, you may find the stack space or heap space is too small, but you have little room to increase it.

  • SANGILI KUMAR said:
    I tried int32(50000)

    The source code you sent me changes it to

    oct_sign(dom(ori_mag[x]), complex<int32>(50000))

    but that generates an error because the template function oct_sign has prototype

    oct_sign(const std::complex<T> & t, const T &)

    Instead try

    oct_sign(dom(ori_mag[x]), int32(50000))

    However, your real problem is in dpTypes.h, where you have the following typedefs:

    typedef unsigned char  uint8;
    typedef unsigned short uint16;
    typedef unsigned int   uint32;
    typedef signed char    int8;
    typedef signed short   int16;
    typedef signed int     int32;
    typedef long long               int64;
    typedef unsigned long long      uint64;
    

    on C5500, "int" is 16 bits. You must change the definition of int32 and uint32 to this:

    #ifdef __TMS320C55X__
    typedef unsigned long uint32;
    typedef   signed long  int32;
    #else
    typedef unsigned int  uint32;
    typedef   signed int   int32;
    #endif
    

    Furthermore, C5500 does not have either an 8 bit or 64 bit type, so you must beware using these typedefs. Code using them will compile, but will not have exactly the number of bits the code expects.  This may lead to computation errors that are undetectable at compilation time.

  • Hi Archaeologist,

            Build successfully no issue while building but when i execute this its not running properly task getting failure.

    Because for other compilers they using STLPort but here i didn't use STLPort that's the reason.

    How can i configure STLPort in CCSv5.2? 

  • SANGILI KUMAR said:
    How can i configure STLPort in CCSv5.2? 

    You shouldn't need to use STLPort.  The C++ library supplied with the TI compiler supplies most (probably all) of the functionality found in STLPort.

    Thanks and regards,

    -George

  • Hi George,

             You are right, But in my case no issues while building the application. 

             When i run the application in chip its not running properly its throwing ERROR code from my project, as per my project error code problem occur in C++ template function. 

             I tried the same project in TI's KEYSTONE EVM with higher version of TI Compiler but no use.

             What the problem what i need to do now?

             But same project is working fine with other TI processor (AM1808, AM335x) with Linux OS. 

    Thanks,

    Sangly

  • Even though the code compiles without error, it might still not be correct for C55x.  This is mostly because C55x is a "16-bit" target.  You may need to adjust the STLport code to successfully port it to C55x.  In an earlier post, I said

    Archaeologist said:
    Furthermore, C5500 does not have either an 8 bit or 64 bit type, so you must beware using these typedefs. Code using them will compile, but will not have exactly the number of bits the code expects.  This may lead to computation errors that are undetectable at compilation time.

    It is possible that this may be contributing to the problem.  You may need to look for every place STLport uses 8-bit or 64-bit types and adjust the code if it truly requires a data type of exactly that size.  There could also be porting problems with multiplication expressions that have "int" arguments but the code expects at least a 32-bit result. 

    You should have a look at http://stlport.sourceforge.net/FAQ.shtml, at question 2.4 "When I switch to STLport in my application, I get errors. Is STLport so bad?"

  • Hi Archaeologist,

                   I noticed the typedef problem in C55xx. So i've tried in Keystone processor TMS320C6678 in that processor only i got this error.

                  Any idea ?

    Thanks

    Sangly 

  • Do the STLport unit tests compile and run without error?

  • Hi Archaeologist

              That's the thing i'm asking. how to import the STLport into CCS and how to build the Unit test ?

              I've imported the STLport for my project but there is lot of errors i guess its need some prebuild library or something.

    Thanks

    Sangly