2

I'm trying to compile libzqm on windows using MinGW (GCC 4.8). Compilation terminates with this error:

'strndup' was not declared in this scope

So, strndup should be in string.h right? I tried to add /mingw/x86_64-w64-mingw32/include to CXXFLAGS but didn't work.

Any suggestion ?

4

1 回答 1

2

Try to add

#define _GNU_SOURCE

before

#include <string.h>

strndup is not standard C but if you use GNU libc, then you do get it by including the extensions as above.

于 2013-07-04T20:15:46.000 回答