Вопрос

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.

Это было полезно?

Решение

That command line option is actually for ld (see manpage), not gcc. You can pass ld command line options via gcc using the -Wl, flag; so I would expect your <linkerarg> to look like this:

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

But you might have to mess about with the quotes to get that quite right...

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top