You need to read <sys/cdefs.h>, specifically the section I put in
there about compilation environments. Or you need to read the Leopard
developer release notes. Or both.
Undefined symbols for architecture i386:
"_system$UNIX2003", referenced from:
_method in obj.o
....
You say: -mmacosx-version-min=10.4
Linker hears: "Hi, I want to link against the 10.4 legacy libraries,
even though I may have imported symbols that only exist in the 10.5
libraries; if that happened, can you please give me a link error?"
This happens because an SDK includes headers, libraries, and so on,
and you've asked it to link against the Tiger libraries.
[ ... ]
Does this make any sense to you?
Yes. Functions which change behaviour because of UNIX conformance
have symbol decorations that get attached to them as a result of which
compilation environment you are using. You can mix compilation
environments, as long as you only use symbols that were also supported
in Tiger because of the UNIX conformance work that had been done
before Tiger shipped (several of us have been working on UNIX
conformance since November 2004 - it was a *very* big project, with
not a lot of people on it full time).
This is similar to the situation where we added 128 bit long double
support to Tiger, and as a result, we decorated functions which had to
know the size of long double (such as "printf") with $LDBL128 or
$LDBL64, and provided weak symbols for legacy applications that didn't
know about the decorations. For example, printf:
% nm /usr/lib/libc.dylib | grep "T _printf"
0006efcc T _printf
00115be4 T _printf$LDBL128
000cb720 T _printf$LDBL64
-
Bottom line is that you should try to use the same compilation
environment for all your code.
Basically, pick an SDK you want to target, and target it across all
your compilation units and linkages.
-- Terry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-kernel/email@hidden