Missing string.h in testODB.cxx

Issue #18 resolved
Mathieu Guigue created an issue

A #include <string.h> is missing in libMidasInterface/tests/testODB.cxx leading to a error during compilation:

libMidasInterface/tests/testODB.cxx: In function ‘int main(int, char**)’:
libMidasInterface/tests/testODB.cxx:48:13: error: ‘strstr’ was not declared in this scope
    else if (strstr(filename, &amp;#34;.xml&amp;#34;)!=0)
             ^~~~~~
libMidasInterface/tests/testODB.cxx:48:13: note: suggested alternative: ‘strtoq’
    else if (strstr(filename, &amp;#34;.xml&amp;#34;)!=0)
             ^~~~~~
             strtoq
libMidasInterface/tests/testODB.cxx:155:12: error: ‘strlen’ was not declared in this scope
      len = strlen(s);
            ^~~~~~
libMidasInterface/tests/testODB.cxx:155:12: note: suggested alternative: ‘mbrlen’
      len = strlen(s);
            ^~~~~~
            mbrlen
make: *** [libMidasInterface/tests/testODB.o] Error 1

Solution: adding #include <string.h> at the beginning of that file solves the issue

Comments (6)

  1. Thomas Lindner

    I couldn’t reproduce the error, presumably because I am using a different compiler; but I committed suggested fix. Can you try and close bug if it works?

  2. Mathieu Guigue reporter

    It seems to be working with this fix, thank you.

    I used gcc 7.3.1 in a DockerFile. If you are interested, I can send you the Dockerfile.

  3. Log in to comment