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

SlrP

macrumors newbie
Original poster
Jan 13, 2013
2
0
I know C and C++. I am new to mac programming. I need examples of how to create libraries and call them using C++, etc. any sources, etc.?. Also, a simple app in cocoa would be useful.:confused:
 
I know C and C++. I am new to mac programming. I need examples of how to create libraries and call them using C++, etc. any sources, etc.?. Also, a simple app in cocoa would be useful.:confused:

Download Xcode.

Create a new project using a "Framework" or "Library" template to create a library.

Create a new project using the "Application / Cocoa application" template to create a Cocoa application.

Add the library to your Cocoa application, include the header files, and just call the library functions.
 
Download Xcode.

Create a new project using a "Framework" or "Library" template to create a library.

Create a new project using the "Application / Cocoa application" template to create a Cocoa application.

Add the library to your Cocoa application, include the header files, and just call the library functions.
Also important to note is that Xcode prefers .framework type libraries. A good example of a library in this format is Simple DirectMedia Layer (SDL for short). Apple offers plenty of example code on their developer pages to help newbies get started: http://developer.apple.com/
 
Also important to note is that Xcode prefers .framework type libraries. A good example of a library in this format is Simple DirectMedia Layer (SDL for short). Apple offers plenty of example code on their developer pages to help newbies get started: http://developer.apple.com/

I wouldn't say it preferred them. It works perfectly well with normal everyday dynamic libraries and static libraries.
 
I wouldn't say it preferred them. It works perfectly well with normal everyday dynamic libraries and static libraries.
Xcode does make adding .framework libraries particularly easy, though - hence the "preferred" comment. If my meaning was off, it wasn't intended.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.