HomeKitADK icon indicating copy to clipboard operation
HomeKitADK copied to clipboard

Linker errors and general understanding of build process

Open g-mocken opened this issue 3 years ago • 2 comments

I am trying to use HomeKit ADK on MacOS Catalina. I want to compile for MacOS (just to get startet) and cross-compile for RaspberryPi.

After building and reading the docs and installing the prerequisites using "brew", I understand that a simple "make all" should perform the macos build. But it fails with HAP related linker errors (such as "Undefined symbols for architecture x86_64: "_HAPAccessorySetupGetSetupHash", referenced from: _Test in HAPAccessorySetupGetSetupHashTest.o". Any suggestions?

Furthermore, I am totally lost as to how the docker-related cross-compilation for RaspberryPi is supposed to be carried out, and I would appreciate some more detailed instructions for the purpose.

g-mocken avatar Mar 02 '21 23:03 g-mocken

Analyzing it in more detail, I am even more confused by the linker warning preceding the "undefined symbol" linker errors quoted above:

ld: warning: ignoring file Output/Darwin-x86_64-apple-darwin19.6.0/Test/hap.a, building for macOS-x86_64 but attempting to link with file built for macOS-x86_64

What architecture "mismatch" is it complaining about?

g-mocken avatar Mar 03 '21 19:03 g-mocken

Finally fixed the problem: I had to remove /usr/local/bin from my $PATH, because it apparently caused tools from brew/binutils to be used in the build process instead of the ones by Apple.

g-mocken avatar Mar 26 '21 15:03 g-mocken