Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jan 14, 2013, 11: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, 07:45 AM   #2
gnasher729
In Time-Out
 
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, 08: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, 12:23 PM   #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, 12:31 PM   #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, 05: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, 01: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

Similar Threads
thread Thread Starter Forum Replies Last Post
Mac programming should be more like iOS programming. moonman239 Mac Programming 13 Feb 17, 2014 02:37 PM
which mac to buy for programming hamed90 Buying Tips and Advice 9 Oct 27, 2013 02:11 PM
Keyboard for programming on Mac ranbo Mac Peripherals 8 Sep 17, 2013 08:04 PM
c programming for mac Sriteja25 Mac Programming 3 Jul 5, 2013 04:00 AM
Programming on a Mac ThunderBow Mac Programming 5 Mar 13, 2013 04:25 AM

Forum Jump

All times are GMT -5. The time now is 09:23 AM.

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

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