1

I am trying to weak-link to the Security framework in Mac OS X (10.8.2, Darwin Kernel Version 12.2.1). It appears that the linker is simply not recognizing the '-weak_framework' tag.

This is the linker error I get -

[cc] Starting link
[cc] i686-apple-darwin11-llvm-gcc-4.2: Security: No such file or directory

What I found interesting (and hence the reason I believe the '-weak_framework' tag isn't recognized), is that when I change '-weak_framework' to '-thisisgarbage', I still get the same error.

I am running an Ant build script, so this is what's in there -

<linkerarg value="-weak_framework" />
<linkerarg value="Security" />

Any input is greatly appreciated.

4

1 回答 1

1

该命令行选项实际上是用于ld(参见手册页),而不是gcc. 您可以通过使用标志传递ld命令行选项;所以我希望你看起来像这样:gcc-Wl,<linkerarg>

<linkerarg value="-Wl,-weak_framework,Security" />

但是您可能不得不弄乱引号才能完全正确...

于 2013-07-26T06:22:51.313 回答