LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 08-12-2009, 06:18 PM   #1
MexDeath
Member
 
Registered: Nov 2008
Location: Dallas
Distribution: Linux Mint, Mandriva, Gentoo.
Posts: 65

Rep: Reputation: 16
Objective-C Newbie


Hi there,

I don't know why, but recently I've felt this need to learn to program in Objective-C. Now, I bought a book, and have been doing some research, but when I get to writing the code... well... things happen.

See, I don't want to buy a Mac just to learn Objective-C, so I wonder if there are any other solutions to successfully program Objective-C under Linux. I've heard of this Gnu-step project, but when I don't know whether to go that way, or if there is an other way. Reason being: I think its an IDE, and I don't like IDE's that much.

Am I wrong with that concept? Does the Gnu-step project include libraries and other useful stuff for Objective-C programming?

Thanks in Advance,

MexDeath.
 
Old 08-12-2009, 06:47 PM   #2
metrofox
Member
 
Registered: Jan 2009
Location: Palermo, Italy
Distribution: Slackware
Posts: 236

Rep: Reputation: 37
I'm looking for a answer, too... I haven't found solutions yet... It looks like hard, but...
 
Old 08-12-2009, 08:51 PM   #3
MexDeath
Member
 
Registered: Nov 2008
Location: Dallas
Distribution: Linux Mint, Mandriva, Gentoo.
Posts: 65

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by metrofox View Post
[...], but...
Yesss... continue...
 
Old 08-13-2009, 07:01 AM   #4
jeromeNP7
Member
 
Registered: Jun 2009
Posts: 101

Rep: Reputation: 19
Objective-C is not restricted to Macs, though it certainly more supported there for having been Steve Jobs pet language for over two decades. The GNU gcc compiler has full support for Objective-C.

GNUStep is a different case. It was once launched as the free alternative to the Steve Jobs Next system and uses Objective-C heavily. But along the way Richard Stallman lost interest in the project in favor of Gnome, and without the celebrity support of Stallman GNUStep died away slowly. It works to some extent, but it can be considered stalled. The WindowMaker GUI environment is based on GNUStep and be treated as a good programming example, but that project also is stalled. Even so, you can use the available codes to learn Objective-C and tinker with it.

Apple still provides good documentation (as always): http://developer.apple.com/documenta...bjectiveC.html.

Linux

Last edited by jeromeNP7; 09-04-2009 at 09:33 PM.
 
Old 08-13-2009, 08:49 AM   #5
MexDeath
Member
 
Registered: Nov 2008
Location: Dallas
Distribution: Linux Mint, Mandriva, Gentoo.
Posts: 65

Original Poster
Rep: Reputation: 16
Good deal, thanks for the information. I think my problem is that I bought this certain book, and just to start off with an example, they go:
Code:
// First program example

#import <Foundation/Foundation.h>

int main( int argc, const char, * argv[])
{
    (Here be Source-Code)

[pool drain];
return 0;
}
Now, when I compile that piece of code, I get an error message making a claim about "Foundation.h" not being found. From my understanding of C, a "x.h" file is a 'Header' file, I'm pretty sure its the same way with Objective-C, but... if that is the case, where can I find such Header file? Or is it something that just comes with Cocoa, or a Mac?

I mean, I can tell my compiler is recognising that I'm working in Objective-C, but its complaining about that infamous "Foundation.h" file.

Last edited by MexDeath; 08-13-2009 at 08:50 AM.
 
Old 08-13-2009, 09:13 AM   #6
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
Install GNUstep, or get a Mac. The Fountation.h is part of the openstep/nextstep/mac/whatever they are calling it now, and is implemented by gnustep outside of OSX.

Really, there is no other API besides gnustep or cocoa, unless you want to create your own, but that would be a really big pain.

addition: gnustep is not a IDE. Its basically a API, but does come with a 'IDE' (if you can call it that) and GUI builder if you want to use them, along with a very, very, overly primitive desktop environment (just enough to show a desktop, basically). But really, gnustep provides all the needed tools to build Objective-C applications, and that is its purpose. From the libraries to the build system, even the runtime, and a bit on the development side.

Last edited by SciYro; 08-13-2009 at 09:18 AM.
 
Old 08-13-2009, 12:40 PM   #7
MexDeath
Member
 
Registered: Nov 2008
Location: Dallas
Distribution: Linux Mint, Mandriva, Gentoo.
Posts: 65

Original Poster
Rep: Reputation: 16
Hey, thanks for the information, now, I downloaded the GNUStep API, but I still get the same error message.

Code:
mexdeath@mexdeath-desktop ~/Documents/ObjC $ gcc -framework Foundation prog1.m -o prog1
gcc: Foundation: No such file or directory
cc1obj: error: unrecognized command line option "-framework"
mexdeath@mexdeath-desktop ~/Documents/ObjC $
Do I have to set up some sort of path? Or is there a special library I have to download as well? I used the following to instal it:

Code:
sudo apt-get install gnustep gnustep-devel
Maybe there's something extra I have to download>instal? I'll check it out in the mean time.

Thanks, again,

MexDeath.

Last edited by MexDeath; 08-13-2009 at 01:18 PM.
 
Old 08-13-2009, 08:57 PM   #8
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
http://www.gnustep.org/resources/doc.../manual_1.html


Objective-C is such pain to get compiling and running, which is shame as its so easy to program in. Anyways, you may want to look at using a IDE, gnustep seems to have two: ProjectCenter and ProjectManager. Anyone should make building a Objective-C program easier.
 
Old 08-14-2009, 10:02 PM   #9
MexDeath
Member
 
Registered: Nov 2008
Location: Dallas
Distribution: Linux Mint, Mandriva, Gentoo.
Posts: 65

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by SciYro View Post
http://www.gnustep.org/resources/doc.../manual_1.html


Objective-C is such pain to get compiling and running, which is shame as its so easy to program in. Anyways, you may want to look at using a IDE, gnustep seems to have two: ProjectCenter and ProjectManager. Anyone should make building a Objective-C program easier.
Well... how could we get started in doing that? The whole making it easier part?

Last edited by MexDeath; 08-14-2009 at 10:03 PM. Reason: Added one more sentence, for better understanding.
 
Old 08-14-2009, 10:39 PM   #10
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
Install projectcenter then read the documentation?

This (very old) tutorial gives a general overview, it mainly focuses upon using the GUI builder but also shows how you can compile and run things:

http://www.gnustep.it/pierre-yves/index.html
 
Old 08-14-2009, 11:00 PM   #11
MexDeath
Member
 
Registered: Nov 2008
Location: Dallas
Distribution: Linux Mint, Mandriva, Gentoo.
Posts: 65

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by SciYro View Post
Install projectcenter then read the documentation?

This (very old) tutorial gives a general overview, it mainly focuses upon using the GUI builder but also shows how you can compile and run things:

http://www.gnustep.it/pierre-yves/index.html
[EDIT: Forget all I just said, let me try it first.]

[2nd EDIT: Nevermind, that was a pain.]
That ProjectCenter was a Pain... too many buttons, easy to get lost. Windows everywhere... chaos. Complete chaos.

Last edited by MexDeath; 08-14-2009 at 11:23 PM.
 
Old 08-14-2009, 11:48 PM   #12
MexDeath
Member
 
Registered: Nov 2008
Location: Dallas
Distribution: Linux Mint, Mandriva, Gentoo.
Posts: 65

Original Poster
Rep: Reputation: 16
It was troublesome. Too many buttons, too many windows. Now, I downloaded GNUStep, and I thought that would have helped me with the "Foundation/Foundation.h" problem... apparently not.

I guess I'll email the book's author and ask him for some feedback. Here's the title if anyone knows the book and can help me out:

"Programming in Objective-C 2.0. - A complete introduction to the Objective-C language for Mac OS X and iPhone development,"
Second Edition by: Stephen G. Kochan.
ISBN - 13: 978-0-321-56615-7
ISBN - 10: 0-321-56615-7
Publisher:Addison Wesley
Part of "Developer's Library" Collection of Books.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
About new objective of Linux+ 2009 linuxjamil Linux - Certification 0 07-07-2009 06:27 AM
Is is possible to program Wxwidgets with Objective C? chutsu Programming 1 03-29-2008 12:36 PM
LXer: Don't Forget The 'C' in Objective-C LXer Syndicated Linux News 0 05-26-2007 01:16 PM
starting to code.. with an objective viniosity Programming 10 02-08-2005 11:05 PM
Objective-C dogn00dles Programming 2 11-29-2003 02:30 AM


All times are GMT -5. The time now is 03:35 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration