Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Tyrakowski

macrumors newbie
Original poster
Nov 6, 2006
2
0
I've been programming on Windows for a few years, but I'm trying to start on Mac.

Being accustomed to Windows programming, I'm confused on a few things.

On Windows, you had source files that were compiled and linked to DLLs. That created an executable file that linked to those DLLs and any files the program needed were separate from the executable. As far as I can tell, on Mac, everything required by the program is within the program's file. Is that right?

I'm not exactly sure what I'm asking because I'm so confused, but what is the equivalent of DLLs, source code, and executable files on Mac?
 

Hobofuzz

macrumors regular
Oct 9, 2006
129
0
I've been programming on Windows for a few years, but I'm trying to start on Mac.

Being accustomed to Windows programming, I'm confused on a few things.

On Windows, you had source files that were compiled and linked to DLLs. That created an executable file that linked to those DLLs and any files the program needed were separate from the executable. As far as I can tell, on Mac, everything required by the program is within the program's file. Is that right?

I'm not exactly sure what I'm asking because I'm so confused, but what is the equivalent of DLLs, source code, and executable files on Mac?

DLL files are the exact same thing as libraries on any unix system.

Think of the Frameworks as your DLLs in Mac OS X. When programming in Cocoa or whatever you're using (as long as it's Obj-C, I believe) you treat frameworks just as you would DLLs. You make sure they're imported into your project and compiled against them. Don't worry about ever having issues with something like "DLL hell" or certain people not having the libraries they need. Every Mac OS X system is identical when it comes to what frameworks the system includes. As long as whoever uses your program has the minimum system version required, it'll work.

And to answer your about the required stuff being inside the program file itself, this is true to a degree. The actual binary is stored within the application bundle (In whatever.app/Contents/MacOS)

The file you double-click is actually a special folder called a bundle. Inside that file are all the programs resources that aren't part of the system, like icons and the like, as well as the actual file that is run when you double click that file.

If you right-click (control+click) on any application, there's a menu item titled "Show Package Contents". If you haven't tried that out yet, you should. It'll give you a basic idea of how Mac OS X (and other systems that implement the OPENSTEP APIs, notably Gnu-Step) handles applications.
 

Tyrakowski

macrumors newbie
Original poster
Nov 6, 2006
2
0
That answers most of my question, thanks!

But I'm confused about some of the terms. Like, what is the "target" and "product"? I have an idea of what they all are, I just can't figure out how they're related.

(on a side note)Did Mac OS Classic applications work the same way?
 

Hobofuzz

macrumors regular
Oct 9, 2006
129
0
The "target" is a set of build options that includes all the GCC flags and the files that will compile into the "product".

The reason the two are different is because many applications that use their own custom bundles and frameworks have more than one target. They'd have a target for the app, then a target for the framework and so on.

And about Mac Classic apps, I don't believe so. Only if they're Carbonized.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.