idevicerestore icon indicating copy to clipboard operation
idevicerestore copied to clipboard

make this project i686-w64-mingw32/bin/ld object file in function is undefined

Open gool123456 opened this issue 1 year ago • 0 comments

I try to make .exe file in mingw64, it shows these errors.

Hskyre@DESKTOP-2ENCR3V /usr/local/lib $ ls libimobiledevice-1.0.a libirecovery-1.0.a libplist++-2.0.la libusbmuxd-2.0.a libzip.la libimobiledevice-1.0.la libirecovery-1.0.la libplist-2.0.a libusbmuxd-2.0.la pkgconfig libimobiledevice-glue-1.0.a libplist++-2.0.a libplist-2.0.dll.a libzip.a libimobiledevice-glue-1.0.la libplist++-2.0.dll.a libplist-2.0.la libzip.dll.a

Here's my command to create the script and everything works fine: $ PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./autogen.sh --host=i686-w64-mingw32 --without-cython --disable-dependency-tracking --prefix=/usr/local

configure: creating ./config.status config.status: creating Makefile config.status: creating src/Makefile config.status: creating docs/Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands config.status: executing libtool commands configure: WARNING: unrecognized options: --without-cython

Configuration for idevicerestore 1.0.0-135-g609f7f0-dirty:

Install prefix: .........: /usr/local

Now type 'make' to build idevicerestore 1.0.0-135-g609f7f0-dirty, and then 'make install' for installation.

The first time you make, some libs will not be found

Hskyre@DESKTOP-2ENCR3V /Gits/idevicerestore $ make

C:/mingw64/bin/make  all-recursive
make[1]: Entering directory 'D:/cygwin64/Gits/idevicerestore'
Making all in src
make[2]: Entering directory 'D:/cygwin64/Gits/idevicerestore/src'
  CCLD     idevicerestore.exe
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: cannot find -lirecovery-1.0: No su
ry
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: cannot find -limobiledevice-1.0: N
ectory
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: cannot find -limobiledevice-glue-1
r directory
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: cannot find -lplist-2.0: No such f
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: cannot find -lzip: No such file or
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:487: idevicerestore.exe] Error 1
make[2]: Leaving directory 'D:/cygwin64/Gits/idevicerestore/src'
Making all in docs
make[2]: Entering directory 'D:/cygwin64/Gits/idevicerestore/docs'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory 'D:/cygwin64/Gits/idevicerestore/docs'
make[2]: Entering directory 'D:/cygwin64/Gits/idevicerestore'
make[2]: Leaving directory 'D:/cygwin64/Gits/idevicerestore'
make[1]: Leaving directory 'D:/cygwin64/Gits/idevicerestore'

I copied this directory lib to D:\cygwin64\usr\i686-w64-mingw32\sys-root\mingw\lib and it worked

But there were a lot of undefined function errors, what should I do?

Then executing the make command will cause an error that the function cannot be found:

$ make
C:/mingw64/bin/make  all-recursive
make[1]: Entering directory 'D:/cygwin64/Gits/idevicerestore'
Making all in src
make[2]: Entering directory 'D:/cygwin64/Gits/idevicerestore/src'
  CCLD     idevicerestore.exe
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-idevicerestore.o: i
n function `idevicerestore_client_free':
/Gits/idevicerestore/src/idevicerestore.c:1455: undefined reference to `_imp__irecv_device_event_unsubsc
ribe'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-idevicerestore.o: i
n function `idevicerestore_start':
/Gits/idevicerestore/src/idevicerestore.c:350: undefined reference to `_imp__irecv_device_event_subscrib
e'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: /Gits/idevicerestore/src/idevicere
store.c:344: undefined reference to `_imp__irecv_set_debug_level'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-ipsw.o: in function
 `ipsw_print_info':
/Gits/idevicerestore/src/ipsw.c:295: undefined reference to `_imp__irecv_devices_get_device_by_hardware_
model'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-normal.o: in functi
on `normal_get_irecv_device':
/Gits/idevicerestore/src/normal.c:204: undefined reference to `_imp__irecv_devices_get_device_by_hardwar
e_model'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-dfu.o: in function
`dfu_client_new':
/Gits/idevicerestore/src/dfu.c:56: undefined reference to `_imp__irecv_open_with_ecid_and_attempts'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: /Gits/idevicerestore/src/dfu.c:61:
 undefined reference to `_imp__irecv_event_subscribe'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-dfu.o: in function
`dfu_client_free':
/Gits/idevicerestore/src/dfu.c:71: undefined reference to `_imp__irecv_close'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-dfu.o: in function
`dfu_get_irecv_device':
/Gits/idevicerestore/src/dfu.c:86: undefined reference to `_imp__irecv_init'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: /Gits/idevicerestore/src/dfu.c:87:
 undefined reference to `_imp__irecv_open_with_ecid_and_attempts'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: /Gits/idevicerestore/src/dfu.c:91:
 undefined reference to `_imp__irecv_devices_get_device_by_client'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: /Gits/idevicerestore/src/dfu.c:98:
 undefined reference to `_imp__irecv_close'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: /Gits/idevicerestore/src/dfu.c:98:
 undefined reference to `_imp__irecv_close'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: /Gits/idevicerestore/src/dfu.c:94:
 undefined reference to `_imp__irecv_get_device_info'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-dfu.o: in function
`dfu_send_buffer':
/Gits/idevicerestore/src/dfu.c:112: undefined reference to `_imp__irecv_send_buffer'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: /Gits/idevicerestore/src/dfu.c:114
: undefined reference to `_imp__irecv_strerror'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-dfu.o: in function
`dfu_send_component':
/Gits/idevicerestore/src/dfu.c:196: undefined reference to `_imp__irecv_send_buffer'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: /Gits/idevicerestore/src/dfu.c:198
: undefined reference to `_imp__irecv_strerror'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-dfu.o: in function
`dfu_get_cpid':
/Gits/idevicerestore/src/dfu.c:215: undefined reference to `_imp__irecv_get_device_info'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-dfu.o: in function
`dfu_is_image4_supported':
/Gits/idevicerestore/src/dfu.c:233: undefined reference to `_imp__irecv_get_device_info'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: /Gits/idevicerestore/src/dfu.c:233
: undefined reference to `_imp__irecv_get_device_info'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-dfu.o: in function
`dfu_get_ap_nonce':
/Gits/idevicerestore/src/dfu.c:249: undefined reference to `_imp__irecv_get_device_info'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-dfu.o: in function
`dfu_get_sep_nonce':
/Gits/idevicerestore/src/dfu.c:274: undefined reference to `_imp__irecv_get_device_info'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-dfu.o: in function
`dfu_send_component_and_command':
/Gits/idevicerestore/src/dfu.c:301: undefined reference to `_imp__irecv_send_command'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-dfu.o: in function
`dfu_send_command':
/Gits/idevicerestore/src/dfu.c:315: undefined reference to `_imp__irecv_send_command'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-dfu.o: in function
`dfu_enter_recovery':
/Gits/idevicerestore/src/dfu.c:375: undefined reference to `_imp__irecv_get_mode'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-dfu.o: in function
`dfu_client_free':
/Gits/idevicerestore/src/dfu.c:71: undefined reference to `_imp__irecv_close'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-dfu.o: in function
`dfu_enter_recovery':
/Gits/idevicerestore/src/dfu.c:457: undefined reference to `_imp__irecv_usb_set_configuration'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-dfu.o: in function
`dfu_send_command':
/Gits/idevicerestore/src/dfu.c:315: undefined reference to `_imp__irecv_send_command'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-dfu.o: in function
`dfu_client_free':
/Gits/idevicerestore/src/dfu.c:71: undefined reference to `_imp__irecv_close'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-dfu.o: in function
`dfu_enter_recovery':
/Gits/idevicerestore/src/dfu.c:578: undefined reference to `_imp__irecv_close'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: /Gits/idevicerestore/src/dfu.c:542
: undefined reference to `_imp__irecv_send_command_breq'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: /Gits/idevicerestore/src/dfu.c:549
: undefined reference to `_imp__irecv_usb_control_transfer'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: /Gits/idevicerestore/src/dfu.c:477
: undefined reference to `_imp__irecv_close'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: /Gits/idevicerestore/src/dfu.c:387
: undefined reference to `_imp__irecv_close'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-recovery.o: in func
tion `recovery_client_free':
/Gits/idevicerestore/src/recovery.c:51: undefined reference to `_imp__irecv_close'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-recovery.o: in func
tion `recovery_client_new':
/Gits/idevicerestore/src/recovery.c:67: undefined reference to `_imp__irecv_open_with_ecid'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: /Gits/idevicerestore/src/recovery.
c:99: undefined reference to `_imp__irecv_event_subscribe'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: /Gits/idevicerestore/src/recovery.
c:92: undefined reference to `_imp__irecv_get_device_info'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-recovery.o: in func
tion `recovery_set_autoboot':
/Gits/idevicerestore/src/recovery.c:108: undefined reference to `_imp__irecv_send_command'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-recovery.o: in func
tion `recovery_send_ticket':
/Gits/idevicerestore/src/recovery.c:248: undefined reference to `_imp__irecv_send_buffer'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: /Gits/idevicerestore/src/recovery.
c:255: undefined reference to `_imp__irecv_send_command'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: /Gits/idevicerestore/src/recovery.
c:251: undefined reference to `_imp__irecv_strerror'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-recovery.o: in func
tion `recovery_send_component':
/Gits/idevicerestore/src/recovery.c:303: undefined reference to `_imp__irecv_send_buffer'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: /Gits/idevicerestore/src/recovery.
c:306: undefined reference to `_imp__irecv_strerror'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-recovery.o: in func
tion `recovery_send_component_and_command':
/Gits/idevicerestore/src/recovery.c:322: undefined reference to `_imp__irecv_send_command'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-recovery.o: in func
tion `recovery_send_ibec':
/Gits/idevicerestore/src/recovery.c:347: undefined reference to `_imp__irecv_send_command_breq'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: /Gits/idevicerestore/src/recovery.
c:352: undefined reference to `_imp__irecv_usb_control_transfer'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-recovery.o: in func
tion `recovery_send_applelogo':
/Gits/idevicerestore/src/recovery.c:378: undefined reference to `_imp__irecv_send_command'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-recovery.o: in func
tion `recovery_send_ramdisk':
/Gits/idevicerestore/src/recovery.c:453: undefined reference to `_imp__irecv_getenv'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: /Gits/idevicerestore/src/recovery.
c:463: undefined reference to `_imp__irecv_send_command'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-recovery.o: in func
tion `recovery_send_kernelcache':
/Gits/idevicerestore/src/recovery.c:492: undefined reference to `_imp__irecv_usb_control_transfer'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: /Gits/idevicerestore/src/recovery.
c:498: undefined reference to `_imp__irecv_send_command'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: /Gits/idevicerestore/src/recovery.
c:501: undefined reference to `_imp__irecv_send_command_breq'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-recovery.o: in func
tion `recovery_enter_restore':
/Gits/idevicerestore/src/recovery.c:151: undefined reference to `_imp__irecv_getenv'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-recovery.o: in func
tion `recovery_is_image4_supported':
/Gits/idevicerestore/src/recovery.c:518: undefined reference to `_imp__irecv_get_device_info'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: /Gits/idevicerestore/src/recovery.
c:518: undefined reference to `_imp__irecv_get_device_info'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-recovery.o: in func
tion `recovery_get_ap_nonce':
/Gits/idevicerestore/src/recovery.c:534: undefined reference to `_imp__irecv_get_device_info'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-recovery.o: in func
tion `recovery_get_sep_nonce':
/Gits/idevicerestore/src/recovery.c:559: undefined reference to `_imp__irecv_get_device_info'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-recovery.o: in func
tion `recovery_send_reset':
/Gits/idevicerestore/src/recovery.c:578: undefined reference to `_imp__irecv_send_command_breq'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-restore.o: in funct
ion `restore_get_irecv_device':
/Gits/idevicerestore/src/restore.c:299: undefined reference to `_imp__irecv_devices_get_device_by_hardwa
re_model'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-limera1n.o: in func
tion `limera1n_is_supported':
/Gits/idevicerestore/src/limera1n.c:39: undefined reference to `_imp__irecv_devices_get_device_by_produc
t_type'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: idevicerestore-limera1n.o: in func
tion `limera1n_exploit':
/Gits/idevicerestore/src/limera1n.c:64: undefined reference to `_imp__irecv_devices_get_device_by_produc
t_type'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: /Gits/idevicerestore/src/limera1n.
c:91: undefined reference to `_imp__irecv_reset_counters'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: /Gits/idevicerestore/src/limera1n.
c:107: undefined reference to `_imp__irecv_usb_control_transfer'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: /Gits/idevicerestore/src/limera1n.
c:125: undefined reference to `_imp__irecv_reset'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: /Gits/idevicerestore/src/limera1n.
c:126: undefined reference to `_imp__irecv_finish_transfer'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: /Gits/idevicerestore/src/limera1n.
c:130: undefined reference to `_imp__irecv_reconnect'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: /Gits/idevicerestore/src/limera1n.
c:136: undefined reference to `_imp__irecv_get_mode'
/usr/lib/gcc/i686-w64-mingw32/11/../../../../i686-w64-mingw32/bin/ld: /Gits/idevicerestore/src/limera1n.
c:93: undefined reference to `_imp__irecv_strerror'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:487: idevicerestore.exe] Error 1
make[2]: Leaving directory 'D:/cygwin64/Gits/idevicerestore/src'
Making all in docs
make[2]: Entering directory 'D:/cygwin64/Gits/idevicerestore/docs'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory 'D:/cygwin64/Gits/idevicerestore/docs'
make[2]: Entering directory 'D:/cygwin64/Gits/idevicerestore'
make[2]: Leaving directory 'D:/cygwin64/Gits/idevicerestore'
make[1]: Leaving directory 'D:/cygwin64/Gits/idevicerestore'

gool123456 avatar Jul 18 '23 11:07 gool123456