Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jan 14, 2013, 10:43 PM   #1
SlrP
macrumors newbie
 
Join Date: Jan 2013
mac programming

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.
SlrP is offline   0 Reply With Quote
Old Jan 15, 2013, 06:45 AM   #2
gnasher729
macrumors G5
 
gnasher729's Avatar
 
Join Date: Nov 2005
Quote:
Originally Posted by SlrP View Post
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.
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.
gnasher729 is offline   0 Reply With Quote
Old Jan 15, 2013, 07:04 AM   #3
wrldwzrd89
macrumors G4
 
wrldwzrd89's Avatar
 
Join Date: Jun 2003
Location: Solon, OH
Quote:
Originally Posted by gnasher729 View Post
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/
__________________
iMac Intel (Rev H, 27"), 1TB HDD, 16GB RAM, 10.8.4
wrldwzrd89 is offline   0 Reply With Quote
Old Jan 15, 2013, 11:23 AM   #4
Cromulent
macrumors 603
 
Cromulent's Avatar
 
Join Date: Oct 2006
Location: The Land of Hope and Glory
Quote:
Originally Posted by wrldwzrd89 View Post
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.
__________________
Neural Advance - Mac OS X, UNIX and Windows Development
Last.fm Profile | Extreme Metal Reviews
MP 4x 2.66Ghz Xeons / 6GB RAM / 640GB + 500GB + 750GB + 1TB HDDs / ATI Radeon 4870 / iPad 3
Cromulent is offline   0 Reply With Quote
Old Jan 15, 2013, 11:31 AM   #5
wrldwzrd89
macrumors G4
 
wrldwzrd89's Avatar
 
Join Date: Jun 2003
Location: Solon, OH
Quote:
Originally Posted by Cromulent View Post
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.
__________________
iMac Intel (Rev H, 27"), 1TB HDD, 16GB RAM, 10.8.4
wrldwzrd89 is offline   0 Reply With Quote
Old Jan 26, 2013, 04:36 AM   #6
Elijah7
macrumors newbie
 
Join Date: Jan 2013
Quote:
Originally Posted by SlrP View Post
.. how to create libraries and call them using C++..
A close question: is there any proved-to-be-convenient c++ logger for Mac?
Elijah7 is offline   0 Reply With Quote
Old Jan 26, 2013, 12:59 PM   #7
lloyddean
macrumors 6502a
 
Join Date: May 2009
Location: Des Moines, WA
The word "logger" has many meanings depending upon context so what's the context and your meaning?
lloyddean is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 10:18 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC