5 years ago.

What is this compilation error ? It is in the mbed core

Error: Called object type 'char' is not a function or function pointer in "opt/ARMCompiler6.11.30/bin/../include/libcxx/algorithm", Line: 2006, Col: 18

Note: I get this using the online compiler.

Hi Mariwan,

Are you building our example? If not, could describe what action/change you did before this error happen?

Thanks, Desmond

posted by Desmond Chen 15 Nov 2019

Correct. Unfortunately, the compiler is misleading .. I thought it was mbed-os that causes the problem. I have to figure out what I made wrong in this code.

int readConfigFile(const char *filename) {
    size_t pos = 0;
    size_t posEnter = 0;
    std::string fName;
    fName.append(filename);
   int filesize = getFileSize(fName);
    if (filesize == -1)
        return -1; //file not found.
    if (filesize > MAX_LENGTH_OF_CONF_FILE) {
        DEBUG_MESSAGE(
   ...
    return result;
}
 

Thank you very much for your help. But the question is still there .. why do the compiler complain about the core of mbed while the problem is in the source code of the project I have?

posted by M J. 19 Nov 2019

.

posted by M J. 19 Nov 2019
Be the first to answer this question.