Trying to build on msys2
rcmpayne opened this issue · 7 comments
getting error on make while building on msys2
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating include/Makefile
config.status: creating tools/Makefile
config.status: creating libirecovery.pc
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
Configuration for libirecovery 0.2.0:
-------------------------------------------
Install prefix: .........: /usr
USB backend: ............: libusb 1.0.21
Now type 'make' to build libirecovery 0.2.0,
and then 'make install' for installation.
# make
make all-recursive
make[1]: Entering directory '/home/rpayne/github/libirecovery-master'
Making all in src
make[2]: Entering directory '/home/rpayne/github/libirecovery-master/src'
CC libirecovery_la-libirecovery.lo
libirecovery.c: In function ‘mobiledevice_connect’:
libirecovery.c:505:2: error: unknown type name ‘SP_DEVICE_INTERFACE_DATA’
SP_DEVICE_INTERFACE_DATA currentInterface;
^~~~~~~~~~~~~~~~~~~~~~~~
libirecovery.c:506:2: error: unknown type name ‘HDEVINFO’
HDEVINFO usbDevices;
^~~~~~~~
libirecovery.c:512:15: warning: implicit declaration of function ‘SetupDiGetClassDevs’ [-Wimplicit-function-declaration]
usbDevices = SetupDiGetClassDevs(&GUID_DEVINTERFACE_DFU, NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);
^~~~~~~~~~~~~~~~~~~
libirecovery.c:512:71: error: ‘DIGCF_PRESENT’ undeclared (first use in this function)
usbDevices = SetupDiGetClassDevs(&GUID_DEVINTERFACE_DFU, NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);
^~~~~~~~~~~~~
libirecovery.c:512:71: note: each undeclared identifier is reported only once for each function it appears in
libirecovery.c:512:87: error: ‘DIGCF_DEVICEINTERFACE’ undeclared (first use in this function)
usbDevices = SetupDiGetClassDevs(&GUID_DEVINTERFACE_DFU, NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);
^~~~~~~~~~~~~~~~~~~~~
libirecovery.c:513:41: error: ‘SP_DEVICE_INTERFACE_DATA’ undeclared (first use in this function)
memset(¤tInterface, '\0', sizeof(SP_DEVICE_INTERFACE_DATA));
^~~~~~~~~~~~~~~~~~~~~~~~
libirecovery.c:514:18: error: request for member ‘cbSize’ in something not a structure or union
currentInterface.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);
^
libirecovery.c:515:27: warning: implicit declaration of function ‘SetupDiEnumDeviceInterfaces’ [-Wimplicit-function-declaratio ]
for(i = 0; usbDevices && SetupDiEnumDeviceInterfaces(usbDevices, NULL, &GUID_DEVINTERFACE_DFU, i, ¤tInterface); i++) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~
libirecovery.c:522:3: error: unknown type name ‘PSP_DEVICE_INTERFACE_DETAIL_DATA’
PSP_DEVICE_INTERFACE_DETAIL_DATA details;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libirecovery.c:523:3: warning: implicit declaration of function ‘SetupDiGetDeviceInterfaceDetail’ [-Wimplicit-function-declaration]
SetupDiGetDeviceInterfaceDetail(usbDevices, ¤tInterface, NULL, 0, &requiredSize, NULL);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libirecovery.c:524:14: error: ‘PSP_DEVICE_INTERFACE_DETAIL_DATA’ undeclared (first use in this function)
details = (PSP_DEVICE_INTERFACE_DETAIL_DATA) malloc(requiredSize);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libirecovery.c:524:48: error: expected ‘;’ before ‘malloc’
details = (PSP_DEVICE_INTERFACE_DETAIL_DATA) malloc(requiredSize);
^~~~~~
libirecovery.c:525:10: error: invalid type argument of ‘->’ (have ‘int’)
details->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA);
^~
libirecovery.c:525:28: error: ‘SP_DEVICE_INTERFACE_DETAIL_DATA’ undeclared (first use in this function)
details->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libirecovery.c:527:9: warning: passing argument 1 of ‘free’ makes pointer from integer without a cast [-Wint-conversion]
free(details);
^~~~~~~
In file included from /usr/include/stdio.h:29:0,
from libirecovery.c:25:
/usr/include/stdlib.h:93:7: note: expected ‘void *’ but argument is of type ‘int’
_VOID _EXFUN_NOTHROW(free,(_PTR));
^
libirecovery.c:531:34: error: invalid type argument of ‘->’ (have ‘int’)
memcpy((void*) result, details->DevicePath, requiredSize - sizeof(DWORD));
^~
libirecovery.c:532:9: warning: passing argument 1 of ‘free’ makes pointer from integer without a cast [-Wint-conversion]
free(details);
^~~~~~~
In file included from /usr/include/stdio.h:29:0,
from libirecovery.c:25:
/usr/include/stdlib.h:93:7: note: expected ‘void *’ but argument is of type ‘int’
_VOID _EXFUN_NOTHROW(free,(_PTR));
^
libirecovery.c:591:2: warning: implicit declaration of function ‘SetupDiDestroyDeviceInfoList’ [-Wimplicit-function-declaratio ]
SetupDiDestroyDeviceInfoList(usbDevices);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
libirecovery.c:601:18: error: request for member ‘cbSize’ in something not a structure or union
currentInterface.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);
^
libirecovery.c:609:36: error: expected ‘;’ before ‘details’
PSP_DEVICE_INTERFACE_DETAIL_DATA details;
^~~~~~~
libirecovery.c:611:3: error: ‘details’ undeclared (first use in this function)
details = (PSP_DEVICE_INTERFACE_DETAIL_DATA) malloc(requiredSize);
^~~~~~~
libirecovery.c:611:48: error: expected ‘;’ before ‘malloc’
details = (PSP_DEVICE_INTERFACE_DETAIL_DATA) malloc(requiredSize);
^~~~~~
make[2]: *** [Makefile:455: libirecovery_la-libirecovery.lo] Error 1
make[2]: Leaving directory '/home/rpayne/github/libirecovery-master/src'
make[1]: *** [Makefile:466: all-recursive] Error 1
make[1]: Leaving directory '/home/rpayne/github/libirecovery-master'
make: *** [Makefile:375: all] Error 2
Try adding LIBS="-lws2_32" when running the autogen.sh
./autogen.sh LIBS="-lws2_32"
Have the same problem.
./autogen.sh LIBS="-lws2_32"
did not work for me!
yea still fails
`rcmpayne@dev MSYS ~/github/libirecovery-master/libirecovery-master
./autogen.sh LIBS="-lws2_32"
libtoolize: putting auxiliary files in '.'.
libtoolize: linking file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: linking file 'm4/libtool.m4'
libtoolize: linking file 'm4/ltoptions.m4'
libtoolize: linking file 'm4/ltsugar.m4'
libtoolize: linking file 'm4/ltversion.m4'
libtoolize: linking file 'm4/lt~obsolete.m4'
configure.ac:26: installing './compile'
configure.ac:6: installing './missing'
src/Makefile.am: installing './depcomp'
configure: loading site script /etc/config.site
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking build system type... x86_64-pc-msys
checking host system type... x86_64-pc-msys
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/x86_64-pc-msys/bin/ld.exe
checking if the linker (/usr/x86_64-pc-msys/bin/ld.exe) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... no, using cp -pR
checking the maximum length of command line arguments... 8192
checking how to convert x86_64-pc-msys file names to x86_64-pc-msys format... func_convert_file_noop
checking how to convert x86_64-pc-msys file names to toolchain format... func_convert_file_noop
checking for /usr/x86_64-pc-msys/bin/ld.exe option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... file_magic ^x86 archive import|^x86 DLL
checking for dlltool... dlltool
checking how to associate runtime and link libraries... func_cygming_dll_for_implib
checking for ar... ar
checking for archiver @file support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -DDLL_EXPORT -DPIC
checking if gcc PIC flag -DDLL_EXPORT -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/x86_64-pc-msys/bin/ld.exe) supports shared libraries... yes
checking whether -lc should be explicitly linked in... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/x86_64-pc-msys/bin/ld.exe
checking if the linker (/usr/x86_64-pc-msys/bin/ld.exe) is GNU ld... yes
checking whether the g++ linker (/usr/x86_64-pc-msys/bin/ld.exe) supports shared libraries... yes
checking for g++ option to produce PIC... -DDLL_EXPORT -DPIC
checking if g++ PIC flag -DDLL_EXPORT -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/x86_64-pc-msys/bin/ld.exe) supports shared libraries... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
checking readline/readline.h usability... yes
checking readline/readline.h presence... yes
checking for readline/readline.h... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for libusb... yes
checking for ANSI C header files... (cached) yes
checking for stdint.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking for ssize_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint8_t... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... yes
checking for strcasecmp... yes
checking for strdup... yes
checking for strerror... yes
checking for strndup... yes
checking whether to enable WIN32 build settings... no
checking for supported compiler flags... -Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter -fvisibility=hidden
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for native large file support... yes
checking for _LARGEFILE_SOURCE value needed for large files... no
checking whether make supports nested variables... (cached) yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating include/Makefile
config.status: creating tools/Makefile
config.status: creating libirecovery.pc
config.status: creating udev/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
Configuration for libirecovery 0.2.0:
Install prefix: .........: /usr
USB backend: ............: libusb 1.0.21
Now type 'make' to build libirecovery 0.2.0,
and then 'make install' for installation.
rcmpayne@dev MSYS ~/github/libirecovery-master/libirecovery-master
make
make all-recursive
make[1]: Entering directory '/home/rcmpayne/github/libirecovery-master/libirecovery-master'
Making all in src
make[2]: Entering directory '/home/rcmpayne/github/libirecovery-master/libirecovery-master/src'
CC libirecovery_la-libirecovery.lo
libirecovery.c: In function ‘mobiledevice_connect’:
libirecovery.c:511:2: error: unknown type name ‘SP_DEVICE_INTERFACE_DATA’
SP_DEVICE_INTERFACE_DATA currentInterface;
^~~~~~~~~~~~~~~~~~~~~~~~
libirecovery.c:512:2: error: unknown type name ‘HDEVINFO’
HDEVINFO usbDevices;
^~~~~~~~
libirecovery.c:518:15: warning: implicit declaration of function ‘SetupDiGetClassDevs’ [-Wimplicit-function-declaration]
usbDevices = SetupDiGetClassDevs(&GUID_DEVINTERFACE_DFU, NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);
^~~~~~~~~~~~~~~~~~~
libirecovery.c:518:71: error: ‘DIGCF_PRESENT’ undeclared (first use in this function)
usbDevices = SetupDiGetClassDevs(&GUID_DEVINTERFACE_DFU, NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);
^~~~~~~~~~~~~
libirecovery.c:518:71: note: each undeclared identifier is reported only once for each function it appears in
libirecovery.c:518:87: error: ‘DIGCF_DEVICEINTERFACE’ undeclared (first use in this function)
usbDevices = SetupDiGetClassDevs(&GUID_DEVINTERFACE_DFU, NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);
^~~~~~~~~~~~~~~~~~~~~
libirecovery.c:519:41: error: ‘SP_DEVICE_INTERFACE_DATA’ undeclared (first use in this function)
memset(¤tInterface, '\0', sizeof(SP_DEVICE_INTERFACE_DATA));
^~~~~~~~~~~~~~~~~~~~~~~~
libirecovery.c:520:18: error: request for member ‘cbSize’ in something not a structure or union
currentInterface.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);
^
libirecovery.c:521:27: warning: implicit declaration of function ‘SetupDiEnumDeviceInterfaces’ [-Wimplicit-function-declaration]
for(i = 0; usbDevices && SetupDiEnumDeviceInterfaces(usbDevices, NULL, &GUID_DEVINTERFACE_DFU, i, ¤tInterface); i++) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~
libirecovery.c:528:3: error: unknown type name ‘PSP_DEVICE_INTERFACE_DETAIL_DATA’
PSP_DEVICE_INTERFACE_DETAIL_DATA details;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libirecovery.c:529:3: warning: implicit declaration of function ‘SetupDiGetDeviceInterfaceDetail’ [-Wimplicit-function-declaration]
SetupDiGetDeviceInterfaceDetail(usbDevices, ¤tInterface, NULL, 0, &requiredSize, NULL);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libirecovery.c:530:14: error: ‘PSP_DEVICE_INTERFACE_DETAIL_DATA’ undeclared (first use in this function)
details = (PSP_DEVICE_INTERFACE_DETAIL_DATA) malloc(requiredSize);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libirecovery.c:530:48: error: expected ‘;’ before ‘malloc’
details = (PSP_DEVICE_INTERFACE_DETAIL_DATA) malloc(requiredSize);
^~~~~~
libirecovery.c:531:10: error: invalid type argument of ‘->’ (have ‘int’)
details->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA);
^~
libirecovery.c:531:28: error: ‘SP_DEVICE_INTERFACE_DETAIL_DATA’ undeclared (first use in this function)
details->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libirecovery.c:533:9: warning: passing argument 1 of ‘free’ makes pointer from integer without a cast [-Wint-conversion]
free(details);
^~~~~~~
In file included from /usr/include/stdio.h:29:0,
from libirecovery.c:25:
/usr/include/stdlib.h:93:7: note: expected ‘void ’ but argument is of type ‘int’
_VOID _EXFUN_NOTHROW(free,(_PTR));
^
libirecovery.c:537:34: error: invalid type argument of ‘->’ (have ‘int’)
memcpy((void) result, details->DevicePath, requiredSize - sizeof(DWORD));
^~
libirecovery.c:538:9: warning: passing argument 1 of ‘free’ makes pointer from integer without a cast [-Wint-conversion]
free(details);
^~~~~~~
In file included from /usr/include/stdio.h:29:0,
from libirecovery.c:25:
/usr/include/stdlib.h:93:7: note: expected ‘void *’ but argument is of type ‘int’
_VOID _EXFUN_NOTHROW(free,(_PTR));
^
libirecovery.c:597:2: warning: implicit declaration of function ‘SetupDiDestroyDeviceInfoList’ [-Wimplicit-function-declaration]
SetupDiDestroyDeviceInfoList(usbDevices);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
libirecovery.c:607:18: error: request for member ‘cbSize’ in something not a structure or union
currentInterface.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);
^
libirecovery.c:615:36: error: expected ‘;’ before ‘details’
PSP_DEVICE_INTERFACE_DETAIL_DATA details;
^~~~~~~
libirecovery.c:617:3: error: ‘details’ undeclared (first use in this function)
details = (PSP_DEVICE_INTERFACE_DETAIL_DATA) malloc(requiredSize);
^~~~~~~
libirecovery.c:617:48: error: expected ‘;’ before ‘malloc’
details = (PSP_DEVICE_INTERFACE_DETAIL_DATA) malloc(requiredSize);
^~~~~~
make[2]: *** [Makefile:457: libirecovery_la-libirecovery.lo] Error 1
make[2]: Leaving directory '/home/rcmpayne/github/libirecovery-master/libirecovery-master/src'
make[1]: *** [Makefile:468: all-recursive] Error 1
make[1]: Leaving directory '/home/rcmpayne/github/libirecovery-master/libirecovery-master'
make: *** [Makefile:377: all] Error 2
`
Can anyone help here? I've tried msys, msys2, 32b, x64 and i cant build libirecovery which is needed to build idevicerestore.
I've just encountered the same issue on Cygwin
maybe you can try to add -lSetupapi, I resolved a similar issue in another project
I have the same issue here on the current commit. I'm unable to compile, getting the same error as original author. Trying both "fixes" above result in the same error as before.