apple / HomeKitADK

Apache License 2.0
2.55k stars 232 forks source link

Linker errors and general understanding of build process #101

Open g-mocken opened 3 years ago

g-mocken commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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.