Skip to content

Compiling A Project That Uses Tao #9

@TheDarkula

Description

@TheDarkula

I am trying to compile this.

Running this:

env CC="o64-clang" CXX="o64-clang++" cargo build --locked --target x86_64-apple-darwin

yields this error:

error: could not find native static library `carbon_hotkey_binding.a`, perhaps an -L flag is missing?

error: could not compile `tao` due to previous error
warning: build failed, waiting for other jobs to finish...
error: build failed

The relevant C files are here.

I also tried to build that file directly with o64-clang carbon_hotkey_binding.c -o carbon_hotkey_binding.a -v:

Debian clang version 11.0.1-2
Target: x86_64-apple-darwin21.1
Thread model: posix
InstalledDir: /usr/bin
 "/usr/lib/llvm-11/bin/clang" -cc1 -triple x86_64-apple-macosx10.14.0 -Wundef-prefix=TARGET_OS_ -Werror=undef-prefix -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name carbon_hotkey_binding.c -mrelocation-model pic -pic-level 2 -mframe-pointer=all -fno-rounding-math -munwind-tables -target-sdk-version=12.0 -fcompatibility-qualified-id-block-type-checking -target-cpu penryn -debugger-tuning=lldb -target-linker-version 609 -v -resource-dir /usr/lib/llvm-11/lib/clang/11.0.1 -isystem /usr/lib/llvm-11/bin/../lib/clang/11.0.1/include -isysroot /usr/local/osxcross/target/bin/../SDK/MacOSX12.0.sdk -cxx-isystem /usr/local/osxcross/target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1 -internal-isystem /usr/local/osxcross/target/bin/../SDK/MacOSX12.0.sdk/usr/local/include -internal-isystem /usr/lib/llvm-11/lib/clang/11.0.1/include -internal-externc-isystem /usr/local/osxcross/target/bin/../SDK/MacOSX12.0.sdk/usr/include -Wno-liblto -fdebug-compilation-dir /root/src/tao-tao-v0.8.3/src/platform_impl/macos/carbon_hotkey -ferror-limit 19 -stack-protector 1 -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fmax-type-align=16 -fcolor-diagnostics -o /tmp/carbon_hotkey_binding-873a40.o -x c carbon_hotkey_binding.c
clang -cc1 version 11.0.1 based upon LLVM 11.0.1 default target x86_64-pc-linux-gnu
ignoring nonexistent directory "/usr/local/osxcross/target/bin/../SDK/MacOSX12.0.sdk/usr/local/include"
ignoring nonexistent directory "/usr/local/osxcross/target/bin/../SDK/MacOSX12.0.sdk/Library/Frameworks"
ignoring duplicate directory "/usr/lib/llvm-11/bin/../lib/clang/11.0.1/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/llvm-11/bin/../lib/clang/11.0.1/include
 /usr/local/osxcross/target/bin/../SDK/MacOSX12.0.sdk/usr/include
 /usr/local/osxcross/target/bin/../SDK/MacOSX12.0.sdk/System/Library/Frameworks (framework directory)
End of search list.
 "/usr/local/osxcross/target/bin/x86_64-apple-darwin21.1-ld" -demangle -lto_library /usr/lib/llvm-11/lib/libLTO.dylib -no_deduplicate -dynamic -arch x86_64 -platform_version macos 10.14.0 12.0 -syslibroot /usr/local/osxcross/target/bin/../SDK/MacOSX12.0.sdk -o carbon_hotkey_binding.a /tmp/carbon_hotkey_binding-873a40.o -lSystem
Undefined symbols for architecture x86_64:
  "_GetApplicationEventTarget", referenced from:
      _install_event_handler in carbon_hotkey_binding-873a40.o
      _register_hotkey in carbon_hotkey_binding-873a40.o
  "_GetEventParameter", referenced from:
      _hotkey_handler in carbon_hotkey_binding-873a40.o
  "_InstallEventHandler", referenced from:
      _install_event_handler in carbon_hotkey_binding-873a40.o
  "_RegisterEventHotKey", referenced from:
      _register_hotkey in carbon_hotkey_binding-873a40.o
  "_RemoveEventHandler", referenced from:
      _uninstall_event_handler in carbon_hotkey_binding-873a40.o
  "_UnregisterEventHotKey", referenced from:
      _unregister_hotkey in carbon_hotkey_binding-873a40.o
  "_main", referenced from:
     implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Is there something really simple I am missing here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions