From 0f38b2e3925b5d8f8e314db8c68ebbeb272423a5 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 7 Mar 2021 15:21:42 +0100 Subject: Makefile: Fix link error for `UCKeyTranslate` The linker complained about `_UCKeyTranslate` being undefined. It's used by DDHotKey, and is defined in `CoreServices.framework`, so we need to link CoreServices. Here's the error I was getting: clang -x objective-c \ -mmacosx-version-min=10.7 \ -framework Carbon \ -framework Cocoa \ -framework CoreGraphics \ -framework Foundation \ -fno-objc-arc \ -I./build/include \ -L./build \ -lddhotkey \ -o invert-catalina-invert \ Invert.h Invert.m main.m Undefined symbols for architecture x86_64: "_UCKeyTranslate", referenced from: _DDStringFromKeyCode in libddhotkey.a(DDHotKeyUtilities.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index bfceaf8..65a24f3 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,7 @@ all: $(SOURCES) build/libddhotkey.a build/include/*.h -framework Carbon \ -framework Cocoa \ -framework CoreGraphics \ + -framework CoreServices \ -framework Foundation \ -fno-objc-arc \ -I./build/include \ -- cgit v1.2.3