Cargo builds fails: ld framework not found Security

Viewed 591

Trying to run a simple program and it fails with the issue

note: ld: framework not found Security

clang: error: linker command failed with exit code 1 (use -v to see invocation)

I tried to do some investigation and I see that chrono 0.4.19 in cargo.toml points to that. Once I remove that dependency, it stays building. I am new to the mac world and have seen various suggestion but I am very much clueless about the issue.

I tried to dockerise it and it works fine then on container, but doesn't on my mac. Can anyone please point me to the correct direction?

1 Answers

Have you tried adding "-framework Security" to the command line arguments when building? "-framework" is an argument that causes the linker (ld) to see out Dylibs in /System/Library/Frameworks defined as "frameworks". They're technically just dynamic libraries, but require this switch since they're put into a versioned bundle (framework_name.framework/framework_name).

Related