#364 error during make

1.3.0
closed-fixed
Erik
5
2014-12-01
2010-03-14
Gregski
No

The error:
main.cpp:75: error: ‘memcmp’ was not declared in this scope
occurs during a full make at flac-1.2.1/examples/cpp/encode/file
I have fixed it in my distribution by adding a #include <string.h> into main.cpp

Discussion

  • eric herman
    eric herman
    2010-04-30

    Me too.

    Making all in encode
    make[4]: Entering directory `/usr/src/flac/flac-1.2.1/examples/cpp/encode'
    Making all in file
    make[5]: Entering directory `/usr/src/flac/flac-1.2.1/examples/cpp/encode/file'
    if g++ -DHAVE_CONFIG_H -I. -I. -I../../../.. -DFLaC__INLINE=__inline__ -DNDEBUG -I../../../.. -I./include -I../../../../include -march=core2 -msse4 -mcx16 -msahf -O2 -pipe -MT main.o -MD -MP -MF ".deps/main.Tpo" \ -c -o main.o `test -f 'main.cpp' || echo './'`main.cpp; \ then mv -f ".deps/main.Tpo" ".deps/main.Po"; \ else rm -f ".deps/main.Tpo"; exit 1; \ fi
    main.cpp: In function 'int main(int, char**)':
    main.cpp:75: error: 'memcmp' was not declared in this scope
    make[5]: *** [main.o] Error 1

    Easily fixed as you say:

    eric@boxij:~$ cat /usr/src/flac/patches/flac-1.2.1-fix_memcmp_not_declared-1.diff
    diff -Naur flac-1.2.1-orig/examples/cpp/encode/file/main.cpp flac-1.2.1-eric/examples/cpp/encode/file/main.cpp
    --- flac-1.2.1-orig/examples/cpp/encode/file/main.cpp 2007-09-13 17:58:03.000000000 +0200
    +++ flac-1.2.1-eric/examples/cpp/encode/file/main.cpp 2010-04-30 13:36:35.000000000 +0200
    @@ -30,6 +30,7 @@

    #include <stdio.h>
    #include <stdlib.h>
    +#include <string.h>
    #include "FLAC++/metadata.h"
    #include "FLAC++/encoder.h"

    eric@boxij:~$

     

  • Anonymous
    2012-01-26

    Thank you, this fixed the problem.

     
  • Erik
    Erik
    2014-03-21

    • status: open --> closed-fixed
    • assigned_to: Erik
    • Group: --> 1.3.0
     
  • Erik
    Erik
    2014-03-21

    This was fixed in the flac 1.3.0 release.