facebook / fishhook

A library that enables dynamically rebinding symbols in Mach-O binaries running on iOS.
BSD 3-Clause "New" or "Revised" License
5.17k stars 965 forks source link

Undefined symbol: _rebind_symbols in new commit 'aadc161ac3b80db07a9908851839a17ba63a9eb1' #88

Open HawkEleven opened 2 years ago

HawkEleven commented 2 years ago

I pod install fishhook from github, but an error was reported at building: Undefined symbols for architecture arm64: "_rebind_symbols", referenced from: _main in main.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

HawkEleven commented 2 years ago

I found out why is it not compiling successfully. At the head of rebind_symbols() function there is a macro definition of FISHHOOK_VISIBILITY. The FISHHOOK_VISIBILITY depends on the FISHHOOK_EXPORT macro definition. But the FISHHOOK_EXPORT macro definition is not defined. Thus the state of the rebind_symbols() function is hidden. You can comment out FISHHOOK_VISIBILITY and it will compile successfully.