Re: C language in obj-c
Re: C language in obj-c
- Subject: Re: C language in obj-c
- From: Jean-Daniel Dupas <email@hidden>
- Date: Wed, 29 Apr 2009 12:35:04 +0200
Le 29 avr. 09 à 12:25, Alastair Houghton a écrit :
On 29 Apr 2009, at 11:04, fawad shafi wrote:
may be this question is odd, but i wana use .obj file created in c
language, in objective-c.
is it possible??
It depends what you mean. If you're asking if it's possible to use
C code in a program that uses ObjC, of course. Usually you'd
include the C source code in your project and Xcode will just
compile it for you when you hit Build. Then you use the usual
mechanisms to make use of your C code from your ObjC files (i.e. the
"extern" keyword, function prototypes, header files and so on).
You can, of course, include C code in ObjC files directly, since
ObjC is just a superset of the underlying C language.
If you are asking whether you can use .obj files built by (for
instance) Microsoft's compiler, the answer is no. Microsoft's .obj
files use an extended form of COFF, whereas the .o files generated
by OS X compilers use Mach-O
Just for the record, with gcc-llvm, you can no longer assume that .o
files are Mach-O object files.
When you use Link-Time-Optimization (or -O4) with llvm-gcc (or clang),
it produces llvm bytecode (even if the output extension remain .o)
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden