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:
 

gnasher729

Suspended
Nov 25, 2005
17,980
5,565
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.
 

wrldwzrd89

macrumors G5
Jun 6, 2003
12,110
77
Solon, OH
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/
 

Cromulent

macrumors 604
Oct 2, 2006
6,802
1,096
The Land of Hope and Glory
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.
 

wrldwzrd89

macrumors G5
Jun 6, 2003
12,110
77
Solon, OH
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.