Closed hafedh-trimeche closed 3 years ago
I have seen that the new version of MSYS2 does the inclusion of getenv_s by including
Greetings
Hi,
Version updated & patches applied but same errors:
mys version: msys2-x86_64-20210105
FAILED: examples/enroll.exe.p/utilities.c.obj
"cc" "-Iexamples/enroll.exe.p" "-Iexamples" "-I../examples" "-I." "-I.." "-Ilibfprint" "-ID:/msys/mingw64/include/glib-2.0" "-ID:/msys/mingw64/lib/glib-2.0/include" "-ID:/msys/mingw64/include" "-ID:/msys/mingw64/include/gusb-1" "-ID:/msys/mingw64/include/libusb-1.0" "-fdiagnostics-color=always" "-pipe" "-D_FILE_OFFSET_BITS=64" "-Wall" "-Winvalid-pch" "-std=gnu99" "-O3" "-Wall" "-Wcast-align" "-Wformat-nonliteral" "-Wformat-security" "-Wformat=2" "-Wignored-qualifiers" "-Wlogical-op" "-Wmissing-declarations" "-Wmissing-format-attribute" "-Wmissing-include-dirs" "-Wmissing-noreturn" "-Wpointer-arith" "-Wshadow" "-Wtype-limits" "-Wundef" "-Wunused" "-Werror=address" "-Werror=array-bounds" "-Werror=empty-body" "-Werror=init-self" "-Werror=int-to-pointer-cast" "-Werror=main" "-Werror=missing-braces" "-Werror=nonnull" "-Werror=redundant-decls" "-Werror=return-type" "-Werror=sequence-point" "-Werror=trigraphs" "-Werror=write-strings" "-fno-strict-aliasing" "-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_56" "-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_56" "-D_DEFAULT_SOURCE" "-D_XOPEN_SOURCE=700" "-D__MSYS__" "-DG_LOG_DOMAIN=\"libfprint\"" "-Wimplicit-function-declaration" "-Wmissing-prototypes" "-Wnested-externs" "-Wold-style-definition" "-Wstrict-prototypes" "-Werror=implicit" "-Werror=pointer-to-int-cast" "-pthread" "-mms-bitfields" "-mms-bitfields" "-mms-bitfields" "-mms-bitfields" -MD -MQ examples/enroll.exe.p/utilities.c.obj -MF "examples/enroll.exe.p/utilities.c.obj.d" -o examples/enroll.exe.p/utilities.c.obj "-c" ../examples/utilities.c
../examples/utilities.c:136:9: error: redundant redeclaration of 'getenv_s' [-Werror=redundant-decls]
136 | errno_t getenv_s(
| ^~~~~~~~
In file included from ../examples/utilities.c:134:
D:/msys/mingw64/x86_64-w64-mingw32/include/sec_api/stdlib_s.h:17:27: note: previous declaration of 'getenv_s' was here
17 | _CRTIMP errno_t __cdecl getenv_s(size_t *_ReturnSize,char *_DstBuf,rsize_t _DstSize,const char *_VarName);
| ^~~~~~~~
../examples/utilities.c:136:9: warning: 'getenv_s' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
136 | errno_t getenv_s(
| ^~~~~~~~
cc1.exe: some warnings being treated as errors
[92/112] Compiling C object examples/img-capture.exe.p/img-capture.c.obj
[93/112] Generating symbol file libfprint/libfprint-2.dll.p/libfprint-2.dll.symbols
ninja: build stopped: subcommand failed.
Hi. Compatibility problem between MSYS2 versions solved.
Because older versions of MSYS don't include a definition of getenv_s and newer versions do, I changed it to the legacy function getenv. Perhaps future versions will specify the use of a certain version of MSYS2 to maintain compatibility.
Problem solved and tested with the latest version of MSYS2 (msys2-x86_64-20210419.exe) Please check again to close this issue.
Greetings.
Hello,
Verified OK!
Thanks.
Hello,
Please note that meson compile generated an error even the previous command meson build && cd build successed