When I followed the official guide to use Azure Speech SDK golang , I am getting Undefined symbols for architecture x86_64 error. Changed the architecture value etc but it didn't work.
/usr/local/Cellar/go/1.20.5/libexec/pkg/tool/darwin_amd64/link: running cc failed: exit status 1
ld: warning: -no_pie is deprecated when targeting new OS versions
ld: warning: ignoring file <speech-sdk-path>/lib/x86/libMicrosoft.CognitiveServices.Speech.core.so, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x7F 0x45 0x4C 0x46 0x01 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 )
Undefined symbols for architecture x86_64:
"_add_source_lang_config_to_auto_detect_source_lang_config", referenced from:
__cgo_c0b4197be0b1_Cfunc_add_source_lang_config_to_auto_detect_source_lang_config in 000011.o
I found these instructions in an issue under the cognitive-services-speech-sdk-go repo, I finally figured out that Azure guidelines are not updated correctly for MacOS.
Install Speech SDK to your Mac
Setup compiler and linker flags for Go
After this you should be able to use Azure Speech SDK golang in your project.
Source